// typically this file is included at the beginning of your program // a call to InitRROScommands will set up constants that make working // with rCommands easier and more readable InitCommands: InitRROScommands: CalibServoDrive = 110 CalibrateCompass = 111 SetSenseInvMask = 112 SetTurretOffset = 113 SetRotationTime = 114 // calibrate for 90 degrees SetMoveTime = 115 // calibrate for radius distance SetLeftStopOffset = 116 // used to correct motor mismatch and centering SetRightStopOffset = 117 SetTurnStyle = 118 SetSpeed = 119 SetCCdivisor = 120 // used for count correction SetMotorRamp = 121 SetBumpDist = 122 SetProxDist = 123 SetExpanTimeout = 124 SetRobotAngle = 125 // compensate for compass alignment SetBeaconTime = 126 SetClicksPerDiam = 127 SetClicksPer90 = 128 // 129 used internally for rPen TurnToHalfAngle = 130 PlaySound = 131 TestCommand = 132 // returns: argument, 1,2,3,4 StartBalance = 133 EnableMotors = 134 EnableCounters = 135 // 1/0, counters always used for drift compensation SetSlowDownSpeed = 136 MuteBeaconDet = 137 MotorSetup = 138 SensorSetup = 139 SetReducForwRight = 140 SetReducBackRight = 141 SetReducForwLeft = 142 SetReducBackLeft = 143 SetRROStimeout = 144 SetCountDivisor = 145 SetDriveServoWidth = 146 FindBeacon = 147 // argument specifies direction of rotation SetBeaconDelay = 148 // delay till MIDDLE of first timing period SetSteerServoWidth = 149 SetDriveServoDir = 150 SetSteerServoDir = 151 SetRobotDiameter = 152 SetTurretServoWidth= 153 SetTurnToMax = 154 SetTurnToMin = 155 SetSlowDown2 = 156 SetPCBcalibrate = 157 RROSversion = 158 Drive = 159 ReadRangers = 160 // 160-199reserved space for main chip expansion codes // used only when an expansion chip is available ExpansionSetup = 200 // Sends initializing byte BecomeArmExpansion = 201 // typcially used internally only ReadExtSensors = 202 // reads bump, IR, line sensors from external source // typically used only internally by RROS ReadArmSensors = 203 // reads available line sensors from Arm expansion // typically use only internally // codes 204-209 are reserved for RROS use // all codes 210 - 255 are just passed to remote with all five bytes returned // codes 210-229 are reserved for user customized expansions SetNAVbeacons = 230 ReadNAVangles = 231 ReadArmAnalogs = 232 // 2MSB specify #, all 8 bits passed on SetServoIndex = 233 SetServoPosition = 234 // sets current position # to argument, increments # SetServoMin = 235 // sets current offset # to argument, increments # SetServoSpeed = 236 // sets current speed # to argument, increments # SetServoMax = 237 // sets max pulse width # (default 72), increments # EnableServos = 238 // 1 enables, 0 disables, default is disabled GPSsetup = 239 SetGPShighX = 240 SetGPSlowX = 241 // clears high byte automatically SetGPShighY = 242 SetGPSlowY = 243 // clears high byte automatically ExtSensorSetup = 244 LookSetup = 245 PenSetup = 246 SetArmOutputs = 247 SetNAVservoMinHigh = 248 SetNAVservoMinLow = 249 SetNAVservoMaxHigh = 250 SetNAVservoMaxLow = 251 // 251-255 reserved for RROS use // Sounds Pause = 0 LowC = 1 LowD = 2 LowE = 3 LowF = 4 LowG = 5 LowA = 6 LowB = 7 MidC = 8 MidD = 9 MidE = 10 MidF = 11 MidG = 12 MidA = 13 MidB = 14 HighC = 15 HighD = 16 HighE = 17 HighF = 18 HighG = 19 HighA = 20 HighB = 21 Blip1 = 22 Blip2 = 23 InitTone = 24 LowTone = 25 BeepBeep = 26 BeepBeepBeep = 27 Phasor = 28 Siren1 = 29 Siren2 = 30 Siren3 = 31 Double = 7<<5 Whole = 4<<5 Half = 2<<5 Quarter = 1<<5 // Partial song for illustration purposes Data Birthday; MidC|Quarter,MidC|Quarter,MidD|Half,MidC+Whole,MidF+Half,MidE+Half,Pause+Half Data Birthday; MidC+Quarter,MidC+Quarter,MidD+Half,MidC+Whole,MidG+Half,MidF+Half,Pause+Half Data Birthday; MidC+Quarter,MidC+Quarter,HighC+Half,MidA+Half,MidF+Half,MidE+Half,MidD+Whole,Pause+Half Data Birthday; MidB+Quarter,MidB+Quarter,MidA+Half,MidF+Half,MidG+Half,MidF+Whole Data Birthday; 0 SMALLDC = 0 SERVOMOTORS = 1 ROBOCLAW = 2 Steerable = 3 IRSHORT = 0 IRLONG = 1 MAXBOTICS = 2 PING = 3 SR04 = 4 HMC6352 = 1<<3 LSM303 = 2<<3 // possible future implementation ENCODERS = 8 DIGITAL = 0 FIVERANGE = 1<<6 SIXRANGE = 2<<6 GPS = 1 LOOK = 2 PEN = 4 EXTSENSORS = 8 ARM = 1<<4 ARMwOUT = 2<<4 ARMwNAV = 3<<4 return PlayCurrentSong: NotePosition=0 while(1) if CurrentSong[NotePosition]=0 then break; x=rCommand(PlaySound,CurrentSong[NotePosition]) NotePosition++ wend return