week 9 – Assignment

Ready.. Set.. Go..

Concept:

“Ready Set Go” is a project that lets you control 4 LEDs with just one button. you press the button, and the LEDs light up one after the other like a countdown – it’s like creating your own mini light show!

IMG_1096

Challenges:

The most challenging part of the code is likely the button debouncing mechanism. Even when I’ve pressed the button once the LEDs would rapidly change without a bounce or delay

if (digitalRead(5) == HIGH) {
  newcount = count + 1;
  if (newcount != count) {
    // ... (LED control logic)
    count = newcount;
  }
}

Then I had to find the perfect timing. The delay between consecutive state checks (delay(100)) provides a basic form of debouncing. However, finding the right delay duration was a bit hard because too short, it wouldn’t effectively debounce, and if it was too long, it just felt unresponsive.

 

Areas for Improvement:

For future projects, I’d wish to maybe design the code and circuit in a way that makes it easy to add more LEDs or buttons or add one more idea to which pressing the button a certain number of times can show like a mini light show.

 

Leave a Reply