Fab Academy Week14 Group Work

Group Memebers

  • Dara Yanoff
  • Wyatt Goldsmith
  • Abdulaziz Abdulaziz(Aziz)
  • Research

    For this week, we worked as a group to research the use cases and workflows of different programming languages and APIs. Our findings can be viewed in this spreadsheet.

    Python Program

    Then, we used two Python programs to create an interface that sends a message to the Arduino. The first program uses the Python serial library to establish connection between the program and the specified port. In our case, we used Mac port usbmodem1401 as the Arduino was plugged into it. The program then asks the user for input and writes the user input to the pre-selected port. In this case the user is expected to write an integer, which will result in the Arduino built-in LED blinking that many times.

    Program1

    GUI Program

    Similar to the previous program, this program uses Python serial library to communicate with the Arduino. But now, we used the Python GUI(Graphical User Interface) Tkinter library to draw a graphical user interface that enables the user to interact directly with it. For our program, we made five different buttons with different colors; the buttons are labeled 1 to 5. ONce the user presses a button, the relative function will be executed. The code has five different functions for the five buttons. Each function sends an integer between 1-5 to the Arduino according to the button pressed. The Arduino receives this integer and blinks it built-in LED that many times.

    GUIProgram

    Arduino Code

    The Arduino code starts by establishing connection with the Serial Monitor in the setup function. Then, the loop function starts with a while loop that does nothing till it receives an input to the Serial. Once the input is received, a for loop repeats based on the number received to set the LED state high and low that many times with a delay of half a second between each state. This results in the LED blinking as many times as the user chooses from the interface.

    arduinoCode GUI

    Video

    Here is a video of the program working.

    Source File

    All code files can be found here.