is it a syntax error ?
in a test i tried to do a program like this :
hrdwarely, i connected 3-leds with the pins(4,10,12)
then i wrote this code:
' {$STAMP BS2}
' {$PBASIC 2.5}
r PIN 4
hrdwarely, i connected 3-leds with the pins(4,10,12)
then i wrote this code:
' {$STAMP BS2}
' {$PBASIC 2.5}
r PIN 4
Comments
Your code is assigning what is at the input for each declared pin to the array immediately following the declaration of the array. One issue is you’re addressing outside the declared array size which starts at 0, not 1. Another is that you assigning values to the cary variable in your loop, but this won’t have any affect on the I/O pins themselves. Perhaps you could try:
r = 1
or
g = 1
The array is no necessary to address the pins. They can be addressed as an array by themselves. I hope this helps. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering