switch question
ryan4385
Posts: 17
Is there a way to have a pushbutton switch to latch an output that can be unlatch by the stamp
Comments
SD to a switch wired up as shown on page 79 of What's a Microcontroller?
D to Vss (ground)
CP to Vss (ground)
RD to another Stamp I/O pin (different from the one used for the pushbutton)
Q is the flipflop output pin. The Stamp program can read the pushbutton switch setting as shown in Chapter 3 of What's a Microcontroller? The I/O pin connected to RD should be initialized to HIGH. When it's made LOW, the flipflop will reset and stay that way until this pin is made HIGH again.
Datasheet: www.nxp.com/documents/data_sheet/74HC_HCT74.pdf
Tutorial: www.parallax.com/tabid/535/Default.aspx
Post Edited (Mike Green) : 3/25/2010 11:08:24 PM GMT
If you have a button on pin 3 you could do something like \
If IN3 THEN HIGH 5
...
...
...
...
LOW 5
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
U said by using the a flipflop i can do but i cant seem to figure out the program part. if you could real quickly write a program to control the flipflop it would be greatly appreciate?
Ryan
itdoesntwork VAR BIT
trytryagain: pause 1000
DEBUG "We're here to help, but not do your Stamp homework for you."
DEBUG "You must make some effort to learn programming."
DEBUG "Stamp programming is actually fun. Write some code and try it out!"
IF itdoesntwork=1 THEN trytryagain ELSE comebackforhelp
comebackforhelp: DEBUG "Post your code in the forum and ask for assistance",CR
end
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."