ROBOTC.net forums
http://robotc.net/forums/

Communication between cortex and pc
http://robotc.net/forums/viewtopic.php?f=11&t=4585
Page 1 of 1

Author:  LPIE [ Wed May 30, 2012 4:43 am ]
Post subject:  Communication between cortex and pc

Hi,

I would like to know if it's possible to send an instruction to the cortex during the execution of the program.
For example, the robot goes forward and I sends an instruction "stop" to stop it.

Thank you

Author:  jbflot [ Wed May 30, 2012 12:20 pm ]
Post subject:  Re: Communication between cortex and pc

Every time you download a program to the robot, you'll notice that a small Program Debug window pops up. On that window, you'll see a "Start" button that allows you to run the program while the robot is connected over USB or VEXnet. Once the program is running, the button changes to "Stop", which you can press to stop the robot.

Author:  LPIE [ Thu May 31, 2012 8:05 am ]
Post subject:  Re: Communication between cortex and pc

Thank you for your answer. I already saw this windows but the "stop" was just an example. I give you others exemples :
- The robot goes forward and I send an instruction "turn left"
- The robot finds an obstacle and sends me message to tell me this

Author:  jbflot [ Thu May 31, 2012 8:17 am ]
Post subject:  Re: Communication between cortex and pc

You would need to program that behavior yourself. You could use the Remote Control to do it, assigning a different behavior (turn right, left, etc) to different buttons.

Code:
while(true)
{
if(button 5 r is pressed)
{
turn right
}
else if (button 5 l is pressed)
{
turn left
}
}

Author:  LPIE [ Thu May 31, 2012 8:59 am ]
Post subject:  Re: Communication between cortex and pc

And the other way (robot send to PC) is possible or not ?

Author:  jbflot [ Mon Jun 11, 2012 8:30 am ]
Post subject:  Re: Communication between cortex and pc

Quote:
And the other way (robot send to PC) is possible or not ?


I'm not sure what you mean. ROBOTC and the Cortex communicate back and forth.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/