Hi -with some excellent help I've got the bug to reverse and beep:
main:
let pins = %01010000 'make pins 6 and 4 high: full ahead!
if pin2 = 1 then left 'if pin 2 goes high then execute the subroutine "left"
if pin7 = 1 then right 'if pin 7 goes high then execute the subroutine "right"
goto main 'return to main routine
left:
let pins = %00000110 'pin 1 and 2 go high and turns on the red LEDs
for b1 =1 to 5 '5 * (50+50) = 500 this regulates the distance reversed
sound 0, (100,50) ' sets piezo tone and length
pause 50 ' pause
let pins = %10100110 'LEDs and motors on
pause 50 'pause
next b1
let pins = %10010110 'pins 1, 2, 4, 7 go high - LED and one motor forward and one back - left turn
pause 1500 ' this regulates the angle turned
goto main 'lights out - full ahead!
right:
let pins = %00000110 'pin 1 and 2 go high and turn on the red LEDs
for b1 =1 to 5 '5 * (50+50) = 500 this regulates the distance reversed
sound 0, (100,50) ' sets piezo tone and length
pause 50 ' pause
let pins = %10100110 'LEDs and motors on
pause 50 'pause
next b1
let pins =%01100110 'pins 1, 5 and 6 go high - LED and one motor forward and one back - right turn
pause 1500 ' this regulates the angle turned
goto main 'full ahead!
However I can't get the LEDs to flash at the same time as in my earlier prog:
led_loop:
let pins = %0000110 'let pins 1 and 2 go high turning both LEDs on
sound 0, (100,50) ' sets piezo tone and length
pause 50 ' pause
let pins = %00000000 'turn LEDs off
pause 50 'pause
goto led_loop
Am what I'm asking toocomplex?
main:
let pins = %01010000 'make pins 6 and 4 high: full ahead!
if pin2 = 1 then left 'if pin 2 goes high then execute the subroutine "left"
if pin7 = 1 then right 'if pin 7 goes high then execute the subroutine "right"
goto main 'return to main routine
left:
let pins = %00000110 'pin 1 and 2 go high and turns on the red LEDs
for b1 =1 to 5 '5 * (50+50) = 500 this regulates the distance reversed
sound 0, (100,50) ' sets piezo tone and length
pause 50 ' pause
let pins = %10100110 'LEDs and motors on
pause 50 'pause
next b1
let pins = %10010110 'pins 1, 2, 4, 7 go high - LED and one motor forward and one back - left turn
pause 1500 ' this regulates the angle turned
goto main 'lights out - full ahead!
right:
let pins = %00000110 'pin 1 and 2 go high and turn on the red LEDs
for b1 =1 to 5 '5 * (50+50) = 500 this regulates the distance reversed
sound 0, (100,50) ' sets piezo tone and length
pause 50 ' pause
let pins = %10100110 'LEDs and motors on
pause 50 'pause
next b1
let pins =%01100110 'pins 1, 5 and 6 go high - LED and one motor forward and one back - right turn
pause 1500 ' this regulates the angle turned
goto main 'full ahead!
However I can't get the LEDs to flash at the same time as in my earlier prog:
led_loop:
let pins = %0000110 'let pins 1 and 2 go high turning both LEDs on
sound 0, (100,50) ' sets piezo tone and length
pause 50 ' pause
let pins = %00000000 'turn LEDs off
pause 50 'pause
goto led_loop
Am what I'm asking toocomplex?