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
- Ping_Pin = 4
- OBJ
- XB : "FullDuplexSerial"
- Ping : "Ping"
- Pub Start | Counter, range
- XB.start(XB_Rx, XB_Tx, 0, XB_Baud) ' Initialize comms for XBee
- waitcnt(clkfreq + cnt)
- repeat
- range := ping.Inches(ping_pin) ' Get range in inches
- XB.str(string("Ping Measurement:")) ' send string
- XB.dec(range) ' send decimal value
- XB.Tx(CR) ' send Carriage Return
- waitcnt (clkfreq/4 + cnt)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement