TRAFFIC SIGNAL Using Microbit

by krishika m in Circuits > Computers

1474 Views, 0 Favorites, 0 Comments

TRAFFIC SIGNAL Using Microbit

WhatsApp Image 2021-01-08 at 3.04.15 PM.jpeg

HI FRIENDS ,

I made a traffic signal using microbit in tinker cad

Supplies

Components used :

* microbit

* led nos : 3

* resistor nos:3

We Have to Place the Components

WhatsApp Image 2021-01-08 at 3.00.20 PM.jpeg

1 microbit

3 resistors

1 red colour led, 1 yellow colour led , 1 green colour led

Connecting Led 's Cathode

WhatsApp Image 2021-01-08 at 3.00.20 PM (1).jpeg

We have to connect all the led 's cathode to the ground of microbit

Connecting Led ’s Anode

WhatsApp Image 2021-01-08 at 3.00.20 PM (2).jpeg

connect all the led 's anode to the resistor and each resistor is connected to each pins as follows

resistor no 1 to pin no 0

resistor no 2 to pin no 1

resistor no 3 to pin no 2

Coding for the Circuit

WhatsApp Image 2021-01-08 at 3.02.01 PM.jpeg

On start block the coding is: show string TRAFFIC SIGNAL– it displays traffic signal in the microbit with the use of the leds.

In the forever block the coding is:

to on the digital write pin2 ( green colour led) and show GO! On the microbit

then wait for 5 sec after 5 sec off the digital write pin2 (green colour led)

then to on the digital write pin 1 (yellow colour led) and display WAIT on the microbit

and wait for 2 sec and after 2 sec to off the digital write pin 1 (yellow colour led)

then to on the digital write pin 0 ( red colour led) and to show STOP on the microbit

and to wait for 4 sec after 4 sec to off the digital write pin 0

this coding will continues in forever block

I hope you like my traffic signal project