AAUGH!! I cant turn a LED on without HIGH!
Armored Cars
Posts: 172
I have been studying the PBASIC help guide but I cant get any of these to work to turn a LED on.
OUT13=1
PIN13=1
DIR13=1
The only thing that works is
HIGH 13
Please help this is frusterating.
OUT13=1
PIN13=1
DIR13=1
The only thing that works is
HIGH 13
Please help this is frusterating.
Comments
Might try p13=1.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
http://members.rogers.com/steve.brady
http://www.geocities.com/paulsopenstage
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
You can see that HIGH is a bit more convenient as it makes the pin an output (DIR13 = 1), then sets the output driver high (OUT13 = 1). You need both of these actions to get the LED to light.
If you name the LED with the PIN definition, you can do this:
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
Explanation
There are several ways to make a pin an input. When the BASIC Stamp is reset, all of the pins are inputs. Commands that rely on output pins, like PULSIN and SERIN, automatically change the specified pin to input. Writing 0s to particular bits of the variable Dirs makes the corresponding pins outputs. And then there’s the INPUT command.
I was writing 0s instead of 1s.