Description
I don't think this even fulfilled the requirements of the lab, but I've been waiting to build my own version of the thimbletron (http://evolution-control.com/press/photos/thimbletron/slides/ECC_136.htm...). So I figured that, even if I'm not technically using a sensor, I would have input and output in the same space, and using the thimbles as conductors totally works.
Except my design was totally wrong, and all I got were some short circuits. I can make an LED light up with my hands (with the thimbles attached), but that wasn't what I was going for AT ALL. I'll post my code, too, even though I didn't get readings to analog in from my thimbles.
Components
5 thimbles
lots of wires
piezzo speaker (which didn't work as intended, see design flaw above)
LED light (for testing)
![](http://www.emergentdatasystems.com/hand_lab_4.jpg)
![](http://www.emergentdatasystems.com/circuit_lab_4.jpg)
Code
/*
* Katherine Ahern
*
*
*/
int c = 0; // select the input pin for the thimble correlating to c
int e = 1; // select the input pin for the thimble correlating to e
int g = 2; // select the input pin for the thimble correlating to g
int C = 3; // select the input pin for the thimble correlating to high C
int piezzoPin = 9; // select the pin for the LED
int playc = 0; // variable to store the value coming from the sensor
int playe = 0; // variable to store the value coming from the sensor
int playg = 0; // variable to store the value coming from the sensor
int playC = 0; // variable to store the value coming from the sensor
void setup() {
Serial.begin(9600);
}
void loop() {
playc = analogRead(c); // read if c thimble in use
playe = analogRead(e); // read if e thimble in use
playg = analogRead(g); // read if g thimble in use
playC = analogRead(C); // read if C thimble in use
Serial.println(playc);
if (playc > 0) {
digitalWrite(piezzoPin, 956); // play middle c
}
if (playe > 0) {
digitalWrite(piezzoPin, 1519); // play e
}
if (playg > 0) {
digitalWrite(piezzoPin, 1275); // play g
}
if (playC > 0) {
digitalWrite(piezzoPin, 1915); // play high c
}
}
Comments
ooooh katherine! it looks
ooooh katherine! it looks like quite a bit of work. We can work together to get this working if you're interested. Sounds like a fun little project...