LED light control question
Bibliophile6
Posts: 9
·Well now I have a good knowledge with working with LED's.
However what I would like to know, how·can I press a button to turn the light on, but when I let go; the light slowly fades off?
However what I would like to know, how·can I press a button to turn the light on, but when I let go; the light slowly fades off?
Comments
On the BS2, I'd implement that with a PULSOUT command, though I suppose there's several ways to implement this.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lets see what this does... KA BOOM (note to self do not cross red and black)
' {$STAMP BS2}
' What's a Microcontroller - PushbuttonControlledLed.bs2
' Check pushbutton state 10 times per second and blink LED when pressed.
' {$PBASIC 2.5}
DO
· DEBUG HOME
· DEBUG ? IN4
· DEBUG ? IN3
IF (IN3 = 1) THEN
··· HIGH 14
··· PAUSE 50
ELSEIF (IN4 =1) THEN
··· PULSOUT 14,550····<
My Corrections that I did, What did I do wrong?
··· PAUSE 50
· ELSE
··· PAUSE 50
· ENDIF
· LOW 14
· LOW 15
· PAUSE 50
LOOP
You made a change in the program. Look carefully at what you did. Compare it to what you had originally. I think you'll be able to figure out what's happening.