Is It Possible...?
Hi everyone,
I was wondering is it possible to control High and Low signals as well as other features of the Board of Education board with different keys on the keyboard.
For example,
Lets say I have one LED in my circuit and I wish to be able to turn this LED on and off by pressing either the UP arrow key on the keyboard or the DOWN arrow key on the keyboard. So the UP arrow key would be to turn the LED on, and the DOWN arrow key would be used to turn the LED off.
Is this possible?
I know with DEBUGIN you have to type in values/text into the box, but that's not what I'm seeking here, I just want to be able to basically program it in a such a way where events can be controlled by different keys on the keyboard.
Thanks
I was wondering is it possible to control High and Low signals as well as other features of the Board of Education board with different keys on the keyboard.
For example,
Lets say I have one LED in my circuit and I wish to be able to turn this LED on and off by pressing either the UP arrow key on the keyboard or the DOWN arrow key on the keyboard. So the UP arrow key would be to turn the LED on, and the DOWN arrow key would be used to turn the LED off.
Is this possible?
I know with DEBUGIN you have to type in values/text into the box, but that's not what I'm seeking here, I just want to be able to basically program it in a such a way where events can be controlled by different keys on the keyboard.
Thanks
Comments
For those who may come accross this thread later and wanting to do the same thing I'm doing, look at my example code below:
This code turns a LED connected to PIN15 ON if you press the "1" key on your keyboard, and OFF if you press the "2" key on your keyboard.
' {$STAMP BS2}
' {$PBASIC 2.5}
keyboardKey VAR Nib
DO
DEBUGIN DEC1 keyboardKey
IF (keyboardKey = 1) THEN 'if you press 1
HIGH 15
ENDIF
IF (keyboardKey = 2) THEN 'if you press 2
LOW 15
ENDIF
LOOP
I'm not sure how you can set this up for any character on the keyboard, unless it's possible to just use the regular DEBUGIN and compare ascii characters. But you may or may not have to press "Enter" after inputting your character, but I haven't even tried this yet since the above code is more than enough to do what I need.
'