View difference between Paste ID: BstjtpLm and 2evRMn03
SHOW: | | - or go back to the newest paste.
1-
CON 
1+
CON
2-
  _clkmode = xtal1 + pll16x 
2+
  _clkmode = xtal1 + pll16x
3-
  _xinfreq = 5_000_000 
3+
  _xinfreq = 5_000_000
4-
  
4+
5-
  XB_Rx     = 5    ' XBee DOUT 
5+
  XB_Rx     = 0    ' XBee DOUT
6-
  XB_Tx     = 6    ' XBee DIN 
6+
  XB_Tx     = 1    ' XBee DIN
7-
  XB_Baud   = 9600 
7+
  XB_Baud   = 9600
8-
  CR        = 13   ' Carriage Return value       
8+
  CR        = 13   ' Carriage Return value
9-
                                                                      
9+
10-
OBJ 
10+
OBJ
11
   XB    : "FullDuplexSerial"
12
13-
Pub  Start  
13+
Pub  Start
14-
XB.start(XB_Rx, XB_Tx, 0, XB_Baud)       ' Initialize comms for XBee 
14+
XB.start(XB_Rx, XB_Tx, 0, XB_Baud)       ' Initialize comms for XBee
15
waitcnt(clkfreq + cnt)
16-
dira[0..4]~                              ' Pins 0-4 to input
16+
dira[2..6]~                              ' Pins 2-6 to input
17
 repeat
18
    if ina[2] == 0
19-
    if ina[0] == 0
19+
20
      XB.Tx(CR)
21
    if ina[3] == 0
22-
    if ina[1] == 0
22+
23
      XB.Tx(CR)
24-
      XB.Tx(CR)  
24+
25-
    if ina[2] == 0 
25+
26
      XB.Tx(CR)
27-
      XB.Tx(CR)  
27+
    if ina[5] == 0
28
      XB.Str(String("Right",13))
29
      XB.Tx(CR)
30-
      XB.Tx(CR)  
30+
    if ina[6] == 0
31
      XB.Str(String("Up",13))
32
      XB.Tx(CR)
33-
      XB.Tx(CR)  
33+