Assignment 16: Interface and Application Programming
I programmed a graphical user interface (GUI) for my radio
network. As the programming environment I used Processing with ControlP5 GUI
library. I installed the library with Sketch->Import
Library...->Add Library...
I wanted the user interface to have push buttons for toggling the
LEDs and indicators to show the state of the LEDs. I went through
the examples in the ControlP5 library, and the ControlP5 Button
seemed like a good starting point to implement the buttons. The
Serial libraries SimpleRead and SimpleWrite showed how to read from
the serial port and how to write to the serial port. Below is an
example of the operation of the software. The software reads the
serial port, checks the characters, defines the values cl1 and cl2
for the indicator colors accordingly, and draws the circles with
current colors. The previous two events were toggling LED1 to FALSE
and LED2 to TRUE.
The events triggered by the push buttons are shown below. LED1 sends
'1' to serial port, and LED2 sends '2'.
Files:
Processing
code
Home