
Programming
The assignment this week was to write a program that interfaces with an input and/or output device you made.
I decided to develop a program that interfaced with the pressure sensor I made several weeks ago for the input devices week.
Programming is by no means my strongest skill, so instead of working from scratch I decided to work with some existing code.
Neil's example code is great, but scales strangely for my device. I suspect this is due to the capacitance of my pads and the relative size of the different physical circuits.
With the original iteration, the program outputs ~1700 at rest and ~3 when touched, effectively acting as a binary reading. Moreover it displays on a scale of 10,000, wasting 80% of the available screen space. I'd like a bit more resolution from this reading, so I decided to adjust the output to scale to ~100 and display on the appropriate scale bar.
The code was pretty straightforward, I effectively introduced a direct scaling variable and multiplied the original output by this number (0.058), resulting in numbers between 0-100. Additionally, I adjusted the window variable in line 54 to 100 instead of 10000, allowing the outputs to approximately fill the full space available.
Luckily it all worked! Pictures are below. My new code is available here


The new output when untouched
