13.07.2015 Views

Programming - VEX Robotics

Programming - VEX Robotics

Programming - VEX Robotics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

programmingremote control programsprogram five: using the radio control transmitterThis section will explain how to incorporate RadioControl into your programs. Please make sure your RFreceiver module is plugged into the RX1 port of your<strong>VEX</strong> Micro Controller. The rest of your robot should stillbe configured according to the instructions on page 13.1Start a new project in easyC by clicking"New Project" in the "File" menu.2In the "Function Block" window, underthe "Program Flow" heading, find the"While Loop" icon. Drag this into the programwindow between the Begin and End icons.3Set the condition of the while loopas "1==1" in order to create a continuousloop. Click OK.4In the "Function Block" window, under the"RC Control" heading, find the "Tank -2 motor" icon. Drag the "Tank - 2 motor"icon into the "While" loop (drop it between the{ and } icons as shown). This icon causesthe robot to wait for a signal from the radiocontrol transmitter.ConfigBEGINVariablesvoid main (void){Note that the RC Icons only work when they areinside a loop. The icon must be executed repeatedlyby the program in order to provide continuouscontrol. Otherwise it will only give you radio controlfor an invisibly brief moment, then move on.01/31/05Inventor’s Guide8 • 45

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!