Sorry guys, it's been a long time since I've been on the forum. FYI this will be small program to activate a solenoid via an H-bridge for a specific number of milliseconds for a small spot welder using a momentary switch. this will part of the code that will prevent the solenoid from activating more than once in case the switch depressed longer than the pulse being sent to the solenoid. Thanks for any help.
int duration=0;
bool buttonState=false;
void setup() {
// put your setup code here, to run once:
//int durattion=0;
//bool buttonState=false;
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
while(Serial.available());
{
duration=Serial.parseInt();
}
Serial.println(duration);
}