I have a problem with functions start() and stop()
I need when button 'Start' work function start(), and when button STOP - function stop()
it's my code
- Code: Select all
void SerialWorker()
{
if (Serial.available()>4)
{
for (q=0; q<5; q++){bufferArray[q] = Serial.read();}
if(bufferArray[0] == 'S'){ start();}
else { stop;} ///or if(bufferArray[0] != 'S'){ stop();}
}
}
this code not work correctly
after start It works as I have, but problems after stop. Not switch on function stop() or switch after RESET arduino.
How FIX this problem?
I've tried in USO send datapacket at simulatorstop but convertor not send my data after stop.