week 11: Interface and Application Programming

RGB Lights?

The goal for this week was to create an interface for an input/output device that you have. In my seemingly endless stores of random circuit parts and sensors, I found an RGB light:

(It's in front of the OLED)

Using one of my breakout boards, I hooked up the LED to GND and 3 analog pins.

Later into the process, I remembered that this wasn't just any throw away LED and made sure to add some resistors to prevent too much current from coming through and ruining the LED:

To generate a UI, I decided to use the familiar platform: Processing. Processing can speak directly into the serial port a board is on and the board can read the inputs. Using this, I drew up a UI with a button for blue, red, and green. The program would send the first letter of each color through serial whenever the corresponding button was pressed. Given these letters, the board's program would send the values to the LED to generate the corresponding color. It was fairly straightforward: