Both sides previous revision Previous revision Next revision | Previous revision | ||
fabricademy2017:students:nuria.robles:week_5 [2018/01/31 12:56] nuriafablab_gmail.com |
fabricademy2017:students:nuria.robles:week_5 [2018/05/12 00:51] nuriafablab_gmail.com |
||
---|---|---|---|
Line 9: | Line 9: | ||
Next I put velostat between the 2 parts: | Next I put velostat between the 2 parts: | ||
- | {{ :fabricademy2017:students:nuria.robles:week5_e-textiles_wearables:collage_3.png?nolink&969x300 }} | + | {{ :fabricademy2017:students:nuria.robles:week5_e-textiles_wearables:collage_3.png?nolink&1156x358 }} |
Finally I did sew the 2 parts and took care that the contacts didn't touch to each other | Finally I did sew the 2 parts and took care that the contacts didn't touch to each other | ||
Line 24: | Line 24: | ||
| | | | ||
- | |||
- | {{vimeo>240650126?medium}} | ||
I connected the sensor to the ATtiny as suggested in the second part of the assignment, and started to sew ;-) | I connected the sensor to the ATtiny as suggested in the second part of the assignment, and started to sew ;-) | ||
Line 34: | Line 32: | ||
|{{:fabricademy2017:students:nuria.robles:week5_e-textiles_wearables:ass_2.png?nolink&366x300}} |{{:fabricademy2017:students:nuria.robles:week5_e-textiles_wearables:13_img_9623.jpg?nolink&399x300|13_img_9623.jpg}} | | |{{:fabricademy2017:students:nuria.robles:week5_e-textiles_wearables:ass_2.png?nolink&366x300}} |{{:fabricademy2017:students:nuria.robles:week5_e-textiles_wearables:13_img_9623.jpg?nolink&399x300|13_img_9623.jpg}} | | ||
+ | |||
+ | The arduino code I used is: | ||
+ | |||
+ | <code> | ||
+ | |||
+ | /* | ||
+ | CODE for the Fabricademy e-textile sensor swatch | ||
+ | first built for the Fabricademy 2017 | ||
+ | Hannah Perner-Wilson and Mika Satomi, KOBAKANT | ||
+ | */ | ||
+ | |||
+ | #define sensorPin 3 | ||
+ | //#define speakerPin 2 (not tested yet) | ||
+ | #define ledPin 0 | ||
+ | |||
+ | int sensorValue = 0; | ||
+ | //int noiseFrequency = 0; (not tested yet) | ||
+ | int ledBrightness = 0; | ||
+ | |||
+ | void setup() | ||
+ | { | ||
+ | pinMode(sensorPin, INPUT); // use digital pin number here | ||
+ | //pinMode(speakerPin, OUTPUT);(not tested yet) | ||
+ | pinMode(ledPin, OUTPUT); | ||
+ | } | ||
+ | |||
+ | void loop() | ||
+ | { | ||
+ | sensorValue = analogRead(sensorPin); // use analog pin number here | ||
+ | |||
+ | /*(not tested yet) | ||
+ | // MAKE SOUND: | ||
+ | if(sensorValue <900){ | ||
+ | noiseFrequency = map(sensorValue, 0, 1023, 100, 10000); | ||
+ | noise (speakerPin, noiseFrequency); | ||
+ | } | ||
+ | */ (not tested yet) | ||
+ | |||
+ | // FADE LED: | ||
+ | ledBrightness = map(sensorValue, 0, 1023, 0, 255); | ||
+ | analogWrite(ledPin, ledBrightness); | ||
+ | } | ||
+ | |||
+ | /* (not tested yet) | ||
+ | |||
+ | // MAKE SOUND ON THE ATTINY WITHOUT THE SOUND LIBRARY: | ||
+ | void noise (unsigned char noisePin, int frequencyInHertz) { | ||
+ | long delayAmount = (long)(1000000 / frequencyInHertz); | ||
+ | digitalWrite(noisePin, HIGH); | ||
+ | delayMicroseconds(delayAmount); | ||
+ | digitalWrite(noisePin, LOW); | ||
+ | delayMicroseconds(delayAmount); | ||
+ | |||
+ | */ (not tested yet) | ||
+ | } | ||
+ | </code> | ||
The last part I wanted to do is to connect the buzzer and change the sound with the pressure of the fingers over the sensor but I run off time | The last part I wanted to do is to connect the buzzer and change the sound with the pressure of the fingers over the sensor but I run off time |