ajak
- 8th January 2008, 16:24
can you help me determine the errors of this program?
This is my program for my project in school.. Pls. Help an Reply...
'Braitenberg vehicle 1
b0 var byte
b1 var byte
b2 var byte
start:
pot 1, 255,b0 'Read CdS cell # 1
pot 2, 255,b1 'Read CdS cell # 2
If b0 = b1 then straight
if b0 > b1 then left
if b1 > b0 then right
straight:
high 3: high 4
goto start
left:
b2 = b0 'Compare numerical values +/15
if b2 > 15 then left1 'If greater than 15 turn left
goto straight 'If not go to straight subroutine
left1: 'Turn left
high 3: low 4 'Motor control
goto start
right: 'Compare numerical values +/15
b2 = b1 'If greater then 15 points
if b2 > 15 then right1 'Turn toward the right
goto straight 'If not go straight
right1: 'Turn right
high 4: low 3 'Motor control
goto start 'Do again
This is my program for my project in school.. Pls. Help an Reply...
'Braitenberg vehicle 1
b0 var byte
b1 var byte
b2 var byte
start:
pot 1, 255,b0 'Read CdS cell # 1
pot 2, 255,b1 'Read CdS cell # 2
If b0 = b1 then straight
if b0 > b1 then left
if b1 > b0 then right
straight:
high 3: high 4
goto start
left:
b2 = b0 'Compare numerical values +/15
if b2 > 15 then left1 'If greater than 15 turn left
goto straight 'If not go to straight subroutine
left1: 'Turn left
high 3: low 4 'Motor control
goto start
right: 'Compare numerical values +/15
b2 = b1 'If greater then 15 points
if b2 > 15 then right1 'Turn toward the right
goto straight 'If not go straight
right1: 'Turn right
high 4: low 3 'Motor control
goto start 'Do again