flatdog Posted September 14, 2010 Report Posted September 14, 2010 Dear Pete, If I have a momentary switch (pushbutton) and press it the button flag changes from 0 to 1. Does it change back to 0 the next time the button is pressed or on the release of the first press? Thank you, Philip
Pete Dowson Posted September 14, 2010 Report Posted September 14, 2010 If I have a momentary switch (pushbutton) and press it the button flag changes from 0 to 1. Does it change back to 0 the next time the button is pressed or on the release of the first press? As documented, the button flags are toggled each time the associated button goes from "off" to "on". That's why they are useful as latches for momentary buttons. They wouldn't be needed for self-latching (toggle) switches, and would be useless for momentary buttons if they toggled when the buttons went from "on" to "off" as well, wouldn't they? You'd simply use the button state not the flag. Regards Pete
flatdog Posted September 14, 2010 Author Report Posted September 14, 2010 Yes - I see what you mean - daft question with hindsight, it all seems so obvious now. Kind regards, Philip
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now