Assignment 7: Input Devices
This week's assignment was a little difficult, only because there are some many choices for input devices. Even though I would have liked to make many different devices to test an number of different scenarios, I ultimately ended up building a capacitive touch sensor and a light sensor. So, to start I built my own capacitive touch sensor based off of Neil's design. I was a little disappointed in that I was hoping it would measure proximity up to around 5-10 inches away, but ultimately it had little effect until you actually touched the copper surface. To visualize the input, I decided to replicate Neil's python serial script only using Firefly instead. I did have to make some changes to the C code that is loaded onto the chip. First, I had to take the framing code ('1", "2", "3", "4") out of the code and I had to add a carriage return and line feed (as this is what Firefly uses to determine when to start a new line of data. Second, I had to add a new function (thanks for Brian Mayton's help on this) to convert the binary read out into decimal values before sending it over the serial port. Finally, I added commas to separate each up and down value from the step response so that I could easily split the values up once they get inside Grasshopper. Each of the files and a video can be seen below:
- hello.step.45.c (right-click and Save Source As)
- step.Makefile (probably should rename file to just "Makefile")
- Capacitive_setup.ghx (file uses Grasshopper v.8.0001 and Firefly v.1.003)
After working with the step response sensor, I decided I wasn't quite satisfied so I came up with a different visualization approach that utilized a light sensor. This time, I chose to make my own custom sun system in Grasshopper to simulate light propagation on a surface in real-time. There is a multi-dimensional slider which controls the position of the sun and the light sensor reading controls the intesity of light on the surface. In hindsight, it may have been interesting to make a capacitive touch pad or even using one of the Nintendo DS touch screen in tandem with the light sensor (on one single PCB) so that you could control position and intensity in one input device. However, this is still a fairly effective real-time lighting solution. The same C code modifications that had to be introduced in the step response code above were implemented here in order to get Firefly working properly. One thing that is slightly different in this code is that I had to change the line of code: #define bit_delay_time 101 // bit delay for 9600 with overhead. The time delay had to be changed to 101 instead of 100 (as is typical) because I noticed the internal clock on the tiny 45 chip that I was using was slightly off and by changing this value I was able to re-sync the clock and the values coming into Firefly were very smooth.
- hello.light.45.c (right-click and Save Source As)
- light.Makefile (probably should rename file to just "Makefile)