Start button how switch functions in arduino

Open a thread for a question about the simulator control software.
If you cannot receive any data in the input setup use the upper two forums!

Start button how switch functions in arduino

Postby AlexNester » Sat 12. Sep 2015, 15:27

hi all

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.
User avatar
AlexNester
 
Posts: 9
Images: 0
Joined: Tue 24. Sep 2013, 17:49
Location: Ukraine
Has thanked: 0 time
Been thanked: 0 time

Re: Start button how switch functions in arduino

Postby sirnoname » Sat 12. Sep 2015, 16:55

Send me a sample rn2 file to verify your stop setup ind converter.
If a answer is correct or did help you for a solution, please use the solve button.
User avatar
sirnoname
Site Admin
 
Posts: 1829
Images: 45
Joined: Thu 1. Sep 2011, 22:02
Location: Munich, Germany
Has thanked: 35 times
Been thanked: 128 times

Re: Start button how switch functions in arduino

Postby AlexNester » Sat 12. Sep 2015, 17:57

I using USO

Here he is
Attachments
USO2.rar
USO
(1.32 KiB) Downloaded 652 times
User avatar
AlexNester
 
Posts: 9
Images: 0
Joined: Tue 24. Sep 2013, 17:49
Location: Ukraine
Has thanked: 0 time
Been thanked: 0 time


Return to Converter questions

Who is online

Users browsing this forum: No registered users and 2 guests