Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CON
- _clkmode = xtal1 + pll16x
- _xinfreq = 5_000_000
- XB_Rx = 0 ' XBee DOUT
- XB_Tx = 1 ' XBee DIN
- XB_Baud = 9600
- CR = 13 ' Carriage Return value
- OBJ
- XB : "FullDuplexSerial"
- Pub Start
- XB.start(XB_Rx, XB_Tx, 0, XB_Baud) ' Initialize comms for XBee
- waitcnt(clkfreq + cnt)
- dira[2..6]~ ' Pins 2-6 to input
- repeat
- if ina[2] == 0
- XB.Str(String("Down",13))
- XB.Tx(CR)
- if ina[3] == 0
- XB.Str(String("Left",13))
- XB.Tx(CR)
- if ina[4] == 0
- XB.Str(String("Center",13))
- XB.Tx(CR)
- if ina[5] == 0
- XB.Str(String("Right",13))
- XB.Tx(CR)
- if ina[6] == 0
- XB.Str(String("Up",13))
- XB.Tx(CR)
- waitcnt(clkfreq / 3 + cnt)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement