Arduino_Scuola
Published © GPL3+

Tubolar Stretch Sensor Tutorial

How to read the value of a Tubolar Stretch Sensor with your Arduino.

BeginnerProtip15 minutes6,828
Tubolar Stretch Sensor Tutorial

Things used in this project

Hardware components

Arduino LilyPad USB
Arduino LilyPad USB
×1
Tubolar Stretch Sensor (10cm peace)
×1
10 1k 1/4w resistor
×1

Story

Read more

Code

Code snippet #1

Arduino
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);
}

Credits

Arduino_Scuola

Arduino_Scuola

32 projects • 155 followers

Comments