Josiah Densmore
Published © GPL3+

Micro:Bit Police Red and Blue Flashing LEDs and Siren

Micro:Bit Police Red and Blue Flashing LEDs and Siren

EasyFull instructions provided30 minutes102
Micro:Bit Police Red and Blue Flashing LEDs and Siren

Things used in this project

Hardware components

BBC micro:bit board
BBC micro:bit board
×1
Elecrow BBC Micro:bit Prototype Expansion Board Control Electronic Circuits for BBC micro:bit DIY Kit
×1
Micro-USB to USB Cable (Generic)
Micro-USB to USB Cable (Generic)
×1
LED (generic)
LED (generic)
×2
Jumper wires (generic)
Jumper wires (generic)
×1
Speaker: 0.25W, 8 ohms
Speaker: 0.25W, 8 ohms
×1

Software apps and online services

pxt.microbit.org
micro:bit pxt.microbit.org

Hand tools and fabrication machines

python.microbit.org
micro:bit python.microbit.org

Story

Read more

Schematics

mvi_2924_SeA2RSs1zi.MP4

microbit-screenshot_(1)_5ZHbD0elC8.png

Microbit screenshot (1) 5zhbd0elc8

img_2921_ramHulm4Kl.JPG

Img 2921 ramhulm4kl

Code

Code

JavaScript
basic.forever(() => {
    music.playTone(587, music.beat(BeatFraction.Whole))
    music.playTone(440, music.beat(BeatFraction.Whole))
})
basic.forever(() => {
    pins.digitalWritePin(DigitalPin.P12, 1)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P12, 0)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P8, 1)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P8, 0)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P12, 1)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P12, 0)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P8, 1)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P8, 0)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P12, 1)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P12, 0)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P8, 1)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P8, 0)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P12, 1)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P12, 0)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P8, 1)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P8, 0)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P12, 1)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P12, 0)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P8, 1)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P8, 0)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P12, 1)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P12, 0)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P8, 1)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P8, 0)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P12, 1)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P12, 0)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P8, 1)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P8, 0)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P12, 1)
    basic.pause(150)
    pins.digitalWritePin(DigitalPin.P12, 0)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P8, 1)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P8, 0)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P12, 1)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P12, 0)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P8, 1)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P8, 0)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P12, 1)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P12, 0)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P8, 1)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P8, 0)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P12, 1)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P12, 0)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P8, 1)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P8, 0)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P12, 1)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P12, 0)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P8, 1)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P8, 0)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P12, 1)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P12, 0)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P8, 1)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P8, 0)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P12, 1)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P12, 0)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P8, 1)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P8, 0)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P12, 1)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P12, 0)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P8, 1)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P8, 0)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P12, 1)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P12, 0)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P8, 1)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P8, 0)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P12, 1)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P12, 0)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P8, 1)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P8, 0)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P12, 1)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P12, 0)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P8, 1)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P8, 0)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P12, 1)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P12, 0)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P8, 1)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P8, 0)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P12, 1)
    basic.pause(50)
    pins.digitalWritePin(DigitalPin.P12, 0)
    basic.pause(50)
})

Credits

Josiah Densmore

Josiah Densmore

3 projects • 1 follower

Comments

Add projectSign up / LoginAbout BBC micro:bit