/****************************************************************************** * RCX receiver * 20APR04 JRH This is an example main program for the RAV unit receiving * commands from the VCU unit. Note that the only valid commands * from an operator are 1 .. 20, inclusive. * Questions can be directed to Joseph Hansen at * (760) 939-6999, or joseph.hansen@navy.mil *******************************************************************************/ #include "recvInit.h" /**************************************************************** * MAIN TASK: Test routine to show how to use RCX Comm software. ****************************************************************/ task main() { int msgId; /* set the team ID (this must be done first, outside of any loop) */ setTeamId (); /* loop forever, getting any new commands and processing them */ while (true) { /* get the message */ getMsg (msgId); /* act on it (the following are examples only) */ /* your code will interpret commands so that the RAV will go to Point A/B, C, or D */ /* therefore, you will need to develop your own command set, and RAV logic software */ if (msgId == 1) PlayTone (110, 25); else if (msgId == 2) PlayTone (220, 25); else if (msgId == 3) PlayTone (330, 25); else if (msgId == 4) PlayTone (440, 25); else if (msgId == 5) PlayTone (550, 25); else if (msgId == 6) PlayTone (660, 25); else if (msgId == 7) PlayTone (770, 25); else if (msgId == 8) PlayTone (880, 25); } } /* main */