15. Interface and application programming
Write an application that interfaces with an input and/or output device
For this week, I decided to use the board and sensors that I used for W.10 Input Devices to visualize force intensity. Because I'm more comfortable using Arduino's IDE, I decided to prototype the code on an Arduino Uno, use Processing to visualize, and then change the appropriate pin-outs and upload the sketch to my milled board.
I connected three force sensitive resistors in the same manner that I had in week 10. Then I uploaded a sketch I had written previously to make sure the connections are correct. The board, serial port and appropriate pins were adjusted and uploaded and then the values of force intensity were read in the serial monitor. Each pressed sensor returned the appropriate response corresponding to this sensor, so I continued onto processing to visualise the data.
In order to visualise the data, I decided to assign each force sensitive resistor a color: red, green and blue-based off of the RGB color model. When a particular force sensor is pressed, the assign colors are superimposed on each other, creating a full spectrum of color. Additionally, the value of the intensity of the pressure is mapped to a range from 0-255, which is similar to the range for RGB colors. I ran the processing code and it worked quite nice. With the code for processing ready, I connected the milled pcb board, ran the processing sketch and watched the colors change according to which force sensors were selected and with what intensity.
Download the corresponding files here.