PDA

View Full Version : Bumper Bump



Sing America
11-10-2009, 08:18 AM
Hi,
I was wondering if someone could look at this program and allude to my inabilities to get it to work.· The program if attached to the computer works but as soon as I try to run it without the connection to the computer it doesn't.· Checked batteries and that is not it and I have used several boards with the same results.· I would appreciate some knowledge explaining why....

P0 - Bumper 1
P1 - Bumper 2
P2 - Bumper 3
P12 - Left wheel
P13 - Right wheel

Code: I have two,
Main:
DO
· DEBUG ? IN3
· DEBUG ? IN2
· DEBUG ? IN1
··· PULSOUT 12, 700
··· PAUSE 20
··· PULSOUT 13, 800
··· PAUSE 20
····· IF (IN1 = 1) THEN· moveright
····· IF (IN2 = 1) THEN· moveleft
····· IF (IN3 = 1) THEN· backbutton
LOOP
· 'Subprograms---
moveright:
Ends with "return


'Main Program- second one
Main:
DO
DEBUG ? IN3
DEBUG ? IN2
DEBUG ? IN1
······· IF(IN0 = 0)AND(IN1 = 0)AND(IN2 = 0)THEN
···· PULSOUT 12, 700
···· PULSOUT 13, 800
···· PAUSE 10

······ IF IN0 = 1 THEN moveright
········ IF(IN1 = 1) THEN moveleft
······· IF (IN2 = 1) THEN backbutton

····· ENDIF
· GOTO Main
LOOP
Subprograms:
all end with "return"

SRLM
11-10-2009, 10:23 AM
Try commenting out the debugs, and running attached to a computer. Does it work?