Components and supplies
1
10 1k 1/4w resistor
1
Arduino LilyPad USB
1
Tubolar Stretch Sensor (10cm peace)
Project description
Code
Code snippet #1
arduino
Comments
Only logged in users can leave comments
Components and supplies
10 1k 1/4w resistor
Arduino LilyPad USB
Tubolar Stretch Sensor (10cm peace)
Project description
Code
Code snippet #1
arduino
1- int sensorPin = A5; // select the input pin for the sensor int ledPin = 13; // select the pin for the LED int sensorValue = 0; // variable to store the value coming from the sensor void setup() { // declare the ledPin as an OUTPUT: pinMode(ledPin, OUTPUT); } void loop() { // read the value from the sensor: sensorValue = analogRead(sensorPin); // turn the ledPin on digitalWrite(ledPin, HIGH); // stop the program for <sensorValue> milliseconds: delay(sensorValue); // turn the ledPin off: digitalWrite(ledPin, LOW); // stop the program for for <sensorValue> milliseconds: delay(sensorValue);
Comments
Only logged in users can leave comments