Raycher
- 17th September 2005, 06:12
Hi, Iam trying to compile code given for the insectronics bot with the pic basic compiler but only get error messages (new to programming chips).
Eg. Here is the code:
temp var byte ' initialize variables
freq var byte
m_servo var byte
l_servo var byte
r_servo var byte
portb.7 = 0 ' set initial logic states to 0
portb.6 = 0
portb.5 = 0
freq = 13 ' delay value
start:
m_servo = 140 ' set servo position values
l_servo = 140
r_servo = 140
gosub servo
goto start
servo: ' servo positioning subroutine
for temp = 1 to 10
pulsout portb.7,m_servo
pulsout portb.6,l_servo
pulsout portb.5,r_servo
pause freq ' set frequency between 50 - 60 Hz
next temp
return
If I try to compile this is the error messages I get:
error servo- ~1.bas,8:':'or '=' expected (token 'var')
error servo- ~1.bas,9:':'or '=' expected (token 'var')
error servo- ~1.bas,10:':'or '=' expected (token 'var')
error servo- ~1.bas,11:':'or '=' expected (token 'var')
error servo- ~1.bas,12:':'or '=' expected (token 'var')
error servo- ~1.bas,14:'illegal character '.'
error servo- ~1.bas,14:':'or '=' expected (token '7')
etc....etc..etc
I will appreciate any help
PS I use a 16F84A chip.
Regards
Eg. Here is the code:
temp var byte ' initialize variables
freq var byte
m_servo var byte
l_servo var byte
r_servo var byte
portb.7 = 0 ' set initial logic states to 0
portb.6 = 0
portb.5 = 0
freq = 13 ' delay value
start:
m_servo = 140 ' set servo position values
l_servo = 140
r_servo = 140
gosub servo
goto start
servo: ' servo positioning subroutine
for temp = 1 to 10
pulsout portb.7,m_servo
pulsout portb.6,l_servo
pulsout portb.5,r_servo
pause freq ' set frequency between 50 - 60 Hz
next temp
return
If I try to compile this is the error messages I get:
error servo- ~1.bas,8:':'or '=' expected (token 'var')
error servo- ~1.bas,9:':'or '=' expected (token 'var')
error servo- ~1.bas,10:':'or '=' expected (token 'var')
error servo- ~1.bas,11:':'or '=' expected (token 'var')
error servo- ~1.bas,12:':'or '=' expected (token 'var')
error servo- ~1.bas,14:'illegal character '.'
error servo- ~1.bas,14:':'or '=' expected (token '7')
etc....etc..etc
I will appreciate any help
PS I use a 16F84A chip.
Regards