View unanswered posts | View active topics It is currently Mon Jul 28, 2014 10:41 am






Reply to topic  [ 6 posts ] 
Communication between cortex and pc 
Author Message
Rookie

Joined: Tue May 15, 2012 10:27 am
Posts: 3
Post 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


Wed May 30, 2012 4:43 am
Profile
Site Admin
Site Admin

Joined: Tue May 15, 2007 9:02 am
Posts: 403
Post 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.

_________________
Jesse Flot
CMU Robotics Academy
ROBOTC Support


Wed May 30, 2012 12:20 pm
Profile
Rookie

Joined: Tue May 15, 2012 10:27 am
Posts: 3
Post 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


Thu May 31, 2012 8:05 am
Profile
Site Admin
Site Admin

Joined: Tue May 15, 2007 9:02 am
Posts: 403
Post 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
}
}

_________________
Jesse Flot
CMU Robotics Academy
ROBOTC Support


Thu May 31, 2012 8:17 am
Profile
Rookie

Joined: Tue May 15, 2012 10:27 am
Posts: 3
Post Re: Communication between cortex and pc
And the other way (robot send to PC) is possible or not ?


Thu May 31, 2012 8:59 am
Profile
Site Admin
Site Admin

Joined: Tue May 15, 2007 9:02 am
Posts: 403
Post 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.

_________________
Jesse Flot
CMU Robotics Academy
ROBOTC Support


Mon Jun 11, 2012 8:30 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.