EmbeddedBlue 500
41
Copyright ©2003 A7 Engineering, Inc.
LMotor CON
13
RMotor CON
12
LfIrOut CON
4
LfIrIn VAR
In11
RtIrOut CON
15
RtIrIn VAR
In14
'-----[Constants]----------------------------------------------
LFwdFast CON
1000
LRevFast CON
500
RFwdFast CON
500
RRevFast CON
1000
'-----[Variables]-----------------------------------------------
irBits VAR
NIB
irLeft VAR
irBits.Bit1
irRight VAR
irBits.Bit0
lastIr VAR
NIB
bBuffer VAR
BYTE(4)
bErrorCode VAR BYTE
'-----[Initialization]------------------------------------------
'Wait for the eb500 radio to be ready
PAUSE 1000
Connect:
'Connect to Monkey-Do
SEROUT
1,84,["con
00:0C:84:00:07:D7",CR]
SERIN
0,84,[WAIT(“ACK”,CR)]
‘Either an Err #<CR> or a ">" will be received
SERIN 0,84,[STR bBuffer\6\”>”]
IF bBuffer(0) = “E” THEN ErrorCode
WaitForConnection:
IF in5 = 0 THEN WaitForConnection