So my problem is pretty straight forward. My project involves FSR sensors embedded into an insole of a shoe. If the user jumps I want it to start a timer to see how long the user stays in the air. Here is my code so far and all it does is print "Hang-time demo"
#include <StopWatch.h>
const int analogInPin = A0; //Analalog port FSR is connected to
int sensorValue;
StopWatch MySW;
void setup() {
Serial.begin(9600);
Serial.println("Hang-time demo");
}
void loop() {
sensorValue = analogRead(A0);
if(sensorValue = 0){
Serial.println(MySW.isRunning());
delay(100);
MySW.start();
Serial.println(MySW.isRunning());
Serial.println("START 1");
Serial.println(MySW.elapsed());
}
if(sensorValue > 0){
MySW.stop();
Serial.println(MySW.isRunning());
Serial.println("STOP");
Serial.println(MySW.elapsed());
}
}
Anyone have any ideas of why it isn't working? Any thoughts are welcome, and thanks in advance!