'****************************************************************
'* Name : UNTITLED.BAS *
'* Author : [select VIEW...EDITOR OPTIONS] *
'* Notice : Copyright © 2008 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 14/11/2008 *
'* Version : 1.0 *
'* Notes : *
'* : *
'****************************************************************
'RX CODE:
'include "modedefs.bas"
'DEFINE OSC 4
'@__config _XT_OSC & _WDT_ON & _CP_OFF
'symbol trisb = 134
'symbol trisa = 133
'symbol portb = 6
'symbol porta = 5
'poke trisa, 0
'poke porta, 0
'low 0
'input 1
'B0 var byte
'B1 var byte
'prestart:
'pause 400
'poke porta, 10
'pause 200
'poke porta, 5
'pause 200
'poke porta, 6
'pause 200
'poke porta, 9
'pause 200
'poke porta, 0
'pause 200
'start:
'serin 1,n9600,B0
'if B0 = 1 then forward
'if B0 = 2 then backward
'if B0 = 3 then left
'if B0 = 4 then right
'if B0 = 5 then nomove
'goto start
'forward:
' poke porta, 10
' goto start
'backward:
' poke porta, 5
' goto start
'right:
' poke porta, 6
' goto start
'left:
' poke porta, 9
' goto start
'nomove:
' poke porta, 0
' goto start
'end
'****************************************************************
'* Name : RufBot TX.BAS *
'* Author : [select VIEW...EDITOR OPTIONS] *
'* Notice : Copyright © 2008 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 11/16/08 *
'* Version : 1.0 *
'* Notes : *
'* : *
'****************************************************************
'include "modedefs.bas"
'DEFINE OSC 4
'@__config _XT_OSC & _WDT_ON & _CP_OFF
'
'trisb = 134
'trisa = 133
'portb = 6
'porta = 5
'low 1
'input 0
'input 2
'B0 var byte
'B1 var byte
'start:
'pot 0,50,B0
'pot 2,50,B1
'B0 = B0 * 5
'B1 = B1 * 5
'y:
'if B0 < 100 then yf
'if B0 > 150 then yb
'x:
'if B1 < 100 then xr
'if B1 > 150 then xl
'serout 1,n9600,[5]
'goto start
'yf:
'serout 1,n9600,[2]
'goto start
'yb:
'serout 1,n9600,[1]
'goto start
'xl:
'serout 1,n9600,[3]
'goto start
'xr:
'serout 1,n9600,[4]
'goto start
'end
Caro colega ele compile normal guando eu programa o pic ele não funciona .tx não se comunica com o tx
O brigado