View difference between Paste ID: HcgpxHhr and ydwuBbnn
SHOW: | | - or go back to the newest paste.
1
CON 
2
  _clkmode = xtal1 + pll16x 
3
  _xinfreq = 5_000_000 
4
  
5-
  XB_Rx     = 0    ' XBee DOUT 
5+
  XB_Rx     = 5    ' XBee DOUT 
6-
  XB_Tx     = 1    ' XBee DIN 
6+
  XB_Tx     = 6    ' XBee DIN 
7
  XB_Baud   = 9600 
8
  CR        = 13   ' Carriage Return value       
9
                                                                    
10
OBJ 
11-
   XB          "FullDuplexSerial"
11+
   XB         : "FullDuplexSerial"
12
   rc         : "RCTime"    
13
Pub  Start |  UD, LR   
14
XB.start(XB_Rx, XB_Tx, 0, XB_Baud) ' Initialize comms for XBee 
15
   
16
waitcnt(clkfreq + cnt)
17
18
 repeat
19
    rc.rctime(0, 1, @LR)
20
    rc.rctime(1, 1, @UD)
21
    XB.Str(String("UD = "))
22
    XB.dec(UD)
23
    XB.Str(String(", LR = "))
24
    XB.dec(LR) 
25
    XB.tx(13)
26
    waitcnt(clkfreq / 2 + cnt)       ' 1/2 second delay