const int buttonPin = 5;
int stadium = 0; // current state of the button
int lastButtonState = 0; // previous state of the button
int startPressed = 0; // the moment the button was pressed
int endPressed = 0; // the moment the button was released
int holdTime = 0; // how long the button was hold
int idleTime = 0; // how long the button was idle
void setup() {
// put your setup code here, to run once:
pinMode(buttonPin, INPUT);
Serial.begin(9600);
buttonState = digitalRead(buttonPin); // read the button input
if (buttonState != lastButtonState) { // button state changed
updateS();
}
lastButtonState = buttonState; // save state for next loop
}
/*void loop() {
// put your main code here, to run repeatedly:
}
*/
void updateS(){
startPressed = millis();
if(stadium == LOW){
}
}