Last Call! We pause shipping on Feb 14th. Order NOW to get your gear shipped before the holiday!



int flex_pin = A0;
void setup(){
pinMode(flex_pin, OUTPUT);
Serial.begin(9600);
}
void loop()
{
// Read the ADC, and calculate voltage and resistance from it
int flex_value = analogRead(flex_pin);
float flex_res = (1023-flex_value) / (flex_value * series_R);
Serial.println("Resistance: " + String(flexR) + " ohms");
// Use the calculated resistance to estimate the sensor's
// bend angle:
float angle = map(flexR, straight_R, bent_R,
0, 90.0);
Serial.println("Bend: " + String(angle) + " degrees");
Serial.println();
delay(500);
}