hi all,
I,ve made an observation while running my little bot that i have to keep changing the value of the speed control setting. I set it up with freshly charged battries to go in straight line after a couple of minutes it will start vering left or right is this to be expected
this is the code am using to test drive the bot
could anyone explain what it is that i'm doing wrong
rob
I,ve made an observation while running my little bot that i have to keep changing the value of the speed control setting. I set it up with freshly charged battries to go in straight line after a couple of minutes it will start vering left or right is this to be expected
Code:
#picaxe28x2
#no_data
#no_table
' HEADSCAN
'*******************************************************************
symbol pan = b.5
symbol rgt = 225
symbol lft = 85
symbol cen = 152
'*******************************************************************
' hood control
'*******************************************************************
symbol hood = b.4
symbol openhod = 90
symbol closehod = 172
'*******************************************************************
' servo speed control
'*******************************************************************
symbol l_back_slow = 153
symbol l_back_fast = 215
symbol l_off = 148
symbol l_forward_slow = 137
symbol l_forward_fast = 75
symbol r_back_fast = 117
symbol r_back_slow = 137
symbol r_off = 143
symbol r_forward_slow = 153
symbol r_forward_fast = 171
symbol r = b.6
symbol l = b.7
symbol counter = b8
init:
servo r, r_off
servo l, l_off
servo pan,cen
servo hood,openhod
'pause 30
'gosub openhood
main:
servopos r, r_forward_slow
servopos l, l_forward_slow
pause 100
goto main
lft90:
servopos r, r_off
servopos l, l_off
pause 100
servopos l,l_back_slow
servopos r,r_forward_slow
pause 1100
return
lft180:
servopos r, r_off
servopos l, l_off
pause 100
servopos l,l_forward_slow
servopos r,r_back_slow
pause 2400
return
rgt90:
servopos r, r_off
servopos l, l_off
pause 100
servopos l,l_forward_slow
servopos r,r_back_slow
pause 1100
return
rgt180:
servopos r, r_off
servopos l, l_off
pause 100
servopos l,l_forward_slow
servopos r,r_back_slow
pause 2400
return
openhood:
for b6 =closehod to openhod step -2
servopos hood,b6
pause 200
next b6
return
closehood:
servopos r, r_off
servopos l, l_off
for b9 =openhod to closehod step 2
servopos hood,b9
pause 200
next b9
return
could anyone explain what it is that i'm doing wrong
rob