11/21: interface and application programming

Do you think he-saurus?

Assignment

-write an application that interfaces with an input and/or output device that you made
-compare as many tool options as possible

Goal

Build an application interface to display identification (by frequency) of an IR light source.

Steps

1. I wanted to visualize the output of the IR sensor on my board in a meaningful way, so I started with my Input Devices board and rudimentary hex output. To begin, I drew out a small user interface indicating the two pieces of information I hoped to output, which are identification of the light frequency, and secondly, the approximate distance of the light source.




2. I then began work on converting hex to ANYthing! This was quite difficult (understatement). I used my Input Weeks board, which has an IR phototransistor, and then I made a small little IR light node to help with testing. The node just had a resistor, a LED, and a battery. With the board plugged in and programmed, I can read the HEX on CoolTerm. Next, I downloaded pySerial and Websocket. I then began working to have the board serially communicate with my nodeServer.js. I used the terminal to test and troubleshoot using node: nodeServer.js /dev/tty.usbserial-FTFMJ8DP 9600 8181. This is the file name, the actual board, the BUAD rate, and the PORT. For the nodeServer.js I had six bytes to worry about, the first four which were simply place holders and then 5 and 6 which provided var low and var high and are the numbers in the HEX changing in relation to a change in light intensity sensed by the IR phototransistor. I am still working on the math for byte 5 and 6 in order to have that be a more meaningful output; right now low light is 1023 and max light is 0. I need to run a simple test, potentially one in the dark and one in ambient indoor lighting conditions, in which I set-up the sensor and test the direct range of the IR light/phototransistor relationship. For future iterations I need to consider both a directional IR light source as well as sensor to allow for increased distances. Right now, in ambient indoor lighting conditions, I only have fidelity out to about 20 cm.




3. With Websocket installed and the PORT set for 8181 I made a test.html file for the output. I originally made a cute ‘Find My Friends (Dino Edition)’ background that I hoped to use as the base for piping in distance and then eventually (final project) identification of a light pattern referenced to a library of patterns. I worked to modify the nodeServer.js file to be able to run test.html, which now outputs a single number!



Struggles

Serial hexidecimal (base 16) on a serial port is not trivial. This is a whole new language!!

Tools

Illustrator
Weller WES51 Soldering Iron
Bausch & Lomb Microscope
Meterman
Programmer Board
CoolTerm
Splitters/Cables
Friends

Source Files

Link to Buggy_Program.c
Link to Make_Buggy.make
Link to nodeServer.js
Link to test.html