Fast Negative Number Countdown (“Boom” Effect)

📟 Micro:bit Project: Fast Negative Number Countdown



How it Works

  • Starts from -999
  • Counts quickly up to 0
  • Then repeats → creates a fast “boom/counting” effect
  • pause(50) controls speed
    • 10 = very fast ⚡
    • 100 = slower

💻Fast Negative Number Countdown JavaScript Code


let display = TM1637.create(DigitalPin.P1, DigitalPin.P2, 4, 7)

// start from -999
let num = -999

basic.forever(function () {

    display.showNumber(num)

    basic.pause(50) // speed (smaller = faster)

    num += 1

    // reset again for loop effect
    if (num > 0) {
        num = -999
    }
})
  

🔌 Wiring Reminder

Using:

  • TM1637 4-digit 7-segment display module

Connect:

  • VCC → 3V
  • GND → GND
  • DIO → P1
  • CLK → P2

⚠️ Important Notes

  • Some TM1637 libraries show negative sign only on left digit
  • If minus - doesn’t show well → limitation of display
  • Max range usually -999 to 9999

💻 Optional: Real “Boom” Effect (Flash + Sound) JavaScript Code


let display = TM1637.create(DigitalPin.P1, DigitalPin.P2, 4, 7)
let num = -50

basic.forever(function () {

    display.showNumber(num)
    basic.pause(50)

    num += 1

    if (num == 0) {
        // BOOM effect
        music.playTone(988, music.beat(BeatFraction.Whole))
        display.showNumber(8888)
        basic.pause(200)

        num = -50
    }
})
  


Post a Comment

Previous Post Next Post