ARDUINO 3-WAY TRAFFIC LIGHT CONTROLLER!!!

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 เม.ย. 2024
  • Components required
    1.Led (Red, green,yellow)
    2.220 ohm resistor (Red, red,brown)
    3.connecting wires
    Code:-
    void setup() {
    // configure the output pins
    pinMode(2,OUTPUT);
    pinMode(3,OUTPUT);
    pinMode(4,OUTPUT);
    pinMode(5,OUTPUT);
    pinMode(6,OUTPUT);
    pinMode(7,OUTPUT);
    pinMode(8,OUTPUT);
    pinMode(9,OUTPUT);
    pinMode(10,OUTPUT);
    }
    void loop()
    {
    digitalWrite(2,1); //enables the 1st set of signals
    digitalWrite(7,1);
    digitalWrite(10,1);
    digitalWrite(4,0);
    digitalWrite(3,0);
    digitalWrite(6,0);
    digitalWrite(8,0);
    digitalWrite(9,0);
    digitalWrite(5,0);
    delay(5000);
    digitalWrite(3,1); //enables the yellow lights
    digitalWrite(6,1);
    digitalWrite(2,0);
    digitalWrite(7,0);
    delay(1000);
    digitalWrite(4,1); //enables the 2nd set of signals
    digitalWrite(5,1);
    digitalWrite(10,1);
    digitalWrite(2,0);
    digitalWrite(3,0);
    digitalWrite(6,0);
    digitalWrite(8,0);
    digitalWrite(9,0);
    digitalWrite(7,0);
    delay(5000);
    digitalWrite(9,1); //enables the yellow lights
    digitalWrite(6,1);
    digitalWrite(10,0);
    digitalWrite(5,0);
    digitalWrite(4,0);
    delay(1000);
    digitalWrite(8,1); //enables the 3rd set of signals
    digitalWrite(4,1);
    digitalWrite(7,1);
    digitalWrite(2,0);
    digitalWrite(3,0);
    digitalWrite(5,0);
    digitalWrite(6,0);
    digitalWrite(9,0);
    digitalWrite(10,0);
    delay(5000);
    digitalWrite(9,1); //enables the yellow lights
    digitalWrite(3,1);
    digitalWrite(7,0);
    digitalWrite(8,0);
    digitalWrite(4,0);
    delay(1000);
    }
    JUST FOLLOW THE VIDEO AND CONTROL TRAFFIC AT YOUR HOME😆😊!!
    -~-~~-~~~-~~-~
    Please watch: "C Programming Language Basics and Essentials |EPISODE 000|Feat @Sourabh Choure|Programming Series "
    • C Programming Language...
    ~-~~-~~~-~~-~

ความคิดเห็น • 16

  • @siddheshdeshmukh1226
    @siddheshdeshmukh1226 4 ปีที่แล้ว +1

    wow man soooo cooool!!!!!

  • @timyg
    @timyg 4 ปีที่แล้ว +1

    nice

    • @ElectronicTechnocrat
      @ElectronicTechnocrat  4 ปีที่แล้ว +1

      Thank you!!!

    • @timyg
      @timyg 4 ปีที่แล้ว +2

      @@ElectronicTechnocrat can u make a 4 way traffic lights

    • @ElectronicTechnocrat
      @ElectronicTechnocrat  4 ปีที่แล้ว +1

      @@timyg yes sure man! Will try for sure

    • @timyg
      @timyg 4 ปีที่แล้ว

      @@ElectronicTechnocrat btw once u posted the vid of the 4 way traffic lights can u tell me in the comments and if u can sub to me plz and give me a shout out in the 4 way traffic lights

    • @timyg
      @timyg 4 ปีที่แล้ว

      My gmail is @gmail.com so email me once u read this thx

  • @ridanorani8623
    @ridanorani8623 3 ปีที่แล้ว

    where to right this code ?

    • @ElectronicTechnocrat
      @ElectronicTechnocrat  3 ปีที่แล้ว +1

      You have to write this code in Arduino IDE software. It's available as a open-source software.

    • @ridanorani8623
      @ridanorani8623 3 ปีที่แล้ว

      @@ElectronicTechnocrat
      Thanks