Problem with LEDs on PDB
StampNut2
Posts: 224
Hello all.
·I am new to this forum and wish to learn programming. I have aquired a PDB with a BSP2-40 Stamp Ihave connected everything up sucessfully to my pc and the PDB is running as it should.
My question is:
I have connected up leds on the PDB to 0-15 on the stamp and run this program. But only 0-7 light up what have I miissed in the program? I know this will be very basic to you guys but I have to start somewhere. Many thanks.
·· ' {$STAMP BS2p}
' {$PBASIC 2.5}
thePin········· VAR···· Nib············ ' pin 0 - 15
Setup:
· DIRA = %111111111111111························· ' make LEDs output, low
Main:
· DO
··· FOR thePIN = 0 TO 15················ ' loop through pins
···· TOGGLE thePin···················· ' toggle current pin
····· DEBUG HOME, BIN15 OUTA············ ' show on Debug
····· PAUSE· 50························ ' short delay
··· NEXT
· LOOP································· ' repeat forever
· END
Post Edited By Moderator (Dave Andreae (Parallax)) : 4/21/2006 10:57:58 PM GMT
·I am new to this forum and wish to learn programming. I have aquired a PDB with a BSP2-40 Stamp Ihave connected everything up sucessfully to my pc and the PDB is running as it should.
My question is:
I have connected up leds on the PDB to 0-15 on the stamp and run this program. But only 0-7 light up what have I miissed in the program? I know this will be very basic to you guys but I have to start somewhere. Many thanks.
·· ' {$STAMP BS2p}
' {$PBASIC 2.5}
thePin········· VAR···· Nib············ ' pin 0 - 15
Setup:
· DIRA = %111111111111111························· ' make LEDs output, low
Main:
· DO
··· FOR thePIN = 0 TO 15················ ' loop through pins
···· TOGGLE thePin···················· ' toggle current pin
····· DEBUG HOME, BIN15 OUTA············ ' show on Debug
····· PAUSE· 50························ ' short delay
··· NEXT
· LOOP································· ' repeat forever
· END
Post Edited By Moderator (Dave Andreae (Parallax)) : 4/21/2006 10:57:58 PM GMT
Comments
PS: Welcome to our forums, and don't forget to add an appropriate subject line to your new treads -- that will get you more responses.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Post Edited (Jon Williams (Parallax)) : 4/21/2006 10:54:28 PM GMT
Many thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nerver give up when things go wrong.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
' {$STAMP BS2p}
' {$PBASIC 2.5}
thePin VAR Nib ' pin 0 - 15
Setup:
DIRS = %111111111111111 ' make LEDs output, low
Main:
DO
FOR thePIN = 0 TO 15 ' loop through pins
TOGGLE thePin ' toggle current pin
DEBUG HOME, BIN15 OUTS ' show on Debug
PAUSE 50 ' short delay
NEXT
LOOP ' repeat forever
END
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never give up when things go wrong.
' {$STAMP BS2p}
' {$PBASIC 2.5}
thePin VAR Nib ' pin 0 - 15
Setup:
DIRS = %111111111111111 ' make LEDs output, low
Main:
DO
FOR thePIN = 0 TO 15 ' loop through pins
TOGGLE thePin ' toggle current pin
DEBUG HOME, BIN15 OUTS ' show on Debug
PAUSE 50 ' short delay
NEXT
LOOP ' repeat forever
END
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never give up when things go wrong.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
OS-X: because making Unix user-friendly was easier than debugging Windows
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never give up when things go wrong.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never give up when things go wrong.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never give up when things go wrong.
·· Remember, with a BS2P40 the P8 through P15 are not on the main I/O header where P0-P15 normally are.· This is in the manual.· Instead they share with the SX I/O pins, so P8 through P15 on that header are actually AUXIO pins.· Please see the PDB Manual· for more information.· I would bet that is where your problem lies.· Your upper 8 LEDs should be connected to the I/O headers on the left side of the board over by the SX chip.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Post Edited (Chris Savage (Parallax)) : 4/22/2006 2:31:33 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never give up when things go wrong.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
MANY THANKS TO THOSE THAT REPLIED TO MY POST. [noparse][[/noparse]GREAT FORUM]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never give up when things go wrong.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax