Skip to main content
10 events
when toggle format what by license comment
Jul 28, 2016 at 12:49 history edited Saransh Malik CC BY-SA 3.0
deleted 42 characters in body
Jul 28, 2016 at 4:57 comment added Michael Niebauer i updated the post with the full code I have. It was interesting to see the use of a while statement. The LED would turn on but it wouldn't cycle thru the different states when the button was pressed.
Jul 28, 2016 at 0:36 comment added Saransh Malik I've edited my post. Please tell me if that works, and if it doesn't, can you post the code for "button_press()" so I can understand the code better.
Jul 28, 2016 at 0:26 history edited Saransh Malik CC BY-SA 3.0
added 1097 characters in body
Jul 27, 2016 at 4:40 vote accept Michael Niebauer
Jul 27, 2016 at 4:40 comment added Michael Niebauer Im sorry can you please be more specific. Maybe some pseudo code.
Jul 26, 2016 at 8:50 comment added Saransh Malik You could potentially put the while switch statement in a loop. That way, it would read the whole code every time it goes through the loop, so if you press down the push button, it will switch the state, and if you don't press the push button, it will just do the same state again. That way, it WILL change the LED based on the potentiometer every time you adjust it, AND it ill work with a software debounce. Hope this helps!
Jul 26, 2016 at 4:24 comment added Michael Niebauer Is there another option for the while condition. I have my button press setup as a boolean function for debouncing.
Jul 26, 2016 at 3:03 review First posts
Jul 26, 2016 at 7:25
Jul 26, 2016 at 3:03 history answered Saransh Malik CC BY-SA 3.0