START A BIT > Blog A Bit > This page
This week, we tried the project to use one same button controlling the LED on/off, we originally wanted to base on PJ003: External LED + button with Micro:bit, use the same hardware setup there, but change to use the external button to on/off the external LED, the idea is to enhance the digital input/output concept, while introducing the Boolean type variable here. By our patient support, the students could finish the programming, but the working result in actual board didn't demonstrate well, we met a classic button problem: the bouncy issue.
This was an unexpected result, we didn't suppose the external button would have such obvious bouncy problem causing so unstable result, it is also the same bad instability even changing to use "if button A is pressed" like the picture shown here. But the good thing is that we use this chance to teach the students to know a little about the bouncy issue, and why it happened, although they might not be able to understand well, but a good lesson for all to understand the importance of some technical details.
We then improved the project setup, so we designed PJ006: Same 1 button to on/off external LED with Micro:bit which uses the built-in button "on button... pressed" block (this block is well de-bouncy handled by Micro:bit runtime) to better secure the good working result to focus on Boolean variable learning.
The hardware wiring
The program for to use one same button to on/off LED, already changed to use built-in button
This was the result from one of our students, bouncy issue
Another student finished this project at home, same bouncy issue