Tugas Program Arduino Traffic Light
Tugas Program Arduino Traffic Light
Tugas Program Arduino Traffic Light
//DEFINISIKAN
//PROGRAMMER NBS
void setup() {
pinMode(UM, OUTPUT);
pinMode(UK, OUTPUT);
pinMode(UH, OUTPUT);
pinMode(TM, OUTPUT);
pinMode(TK, OUTPUT);
pinMode(TH, OUTPUT);
pinMode(SM, OUTPUT);
pinMode(SK, OUTPUT);
pinMode(SH, OUTPUT);
//RANCANGAN NBS
void loop() {
digitalWrite(UM,LOW);
digitalWrite(UK,LOW);
digitalWrite(UH,HIGH);
digitalWrite(TM,HIGH);
digitalWrite(TK,LOW);
digitalWrite(TH,LOW);
digitalWrite(SM,HIGH);
digitalWrite(SK,LOW);
digitalWrite(SH,LOW);
delay(6000);
digitalWrite(UM,LOW);
digitalWrite(UK,HIGH);
digitalWrite(UH,LOW);
digitalWrite(TM,HIGH);
digitalWrite(TK,LOW);
digitalWrite(TH,LOW);
digitalWrite(SM,HIGH);
digitalWrite(SK,LOW);
digitalWrite(SH,LOW);
delay(1000);
digitalWrite(UM,HIGH);
digitalWrite(UK,LOW);
digitalWrite(UH,LOW);
digitalWrite(TM,LOW);
digitalWrite(TK,LOW);
digitalWrite(TH,HIGH);
digitalWrite(SM,HIGH);
digitalWrite(SK,LOW);
digitalWrite(SH,LOW);
delay(6000);
digitalWrite(UM,HIGH);
digitalWrite(UK,LOW);
digitalWrite(UH,LOW);
digitalWrite(TM,LOW);
digitalWrite(TK,HIGH);
digitalWrite(TH,LOW);
digitalWrite(SM,HIGH);
digitalWrite(SK,LOW);
digitalWrite(SH,LOW);
delay(1000);
digitalWrite(UM,HIGH);
digitalWrite(UK,LOW);
digitalWrite(UH,LOW);
digitalWrite(TM,HIGH);
digitalWrite(TK,LOW);
digitalWrite(TH,LOW);
digitalWrite(SM,LOW);
digitalWrite(SK,LOW);
digitalWrite(SH,HIGH);
delay(6000);
digitalWrite(UM,HIGH);
digitalWrite(UK,LOW);
digitalWrite(UH,LOW);
digitalWrite(TM,HIGH);
digitalWrite(TK,LOW);
digitalWrite(TH,LOW);
digitalWrite(SM,LOW);
digitalWrite(SK,HIGH);
digitalWrite(SH,LOW);
delay(1000);
}
Gambar rangkaian skema rangkaian arduino Traffic Light :