Percobaan 1 Kondisi 4
Kondisi awal LED mati lalu hidup bergantian dari tengah ke pinggir secara bergantian
2. Rangkaian Simulasi[Kembali]
int led [ ] = {2, 3, 4, 5, 6, 7, 8, 9};
void setup()
{
for (int i = 0; i <= 7; i++)
{
pinMode (led[i], OUTPUT);
}
}
void loop(){
for (int hidup = 3; hidup >= 0; hidup--)
{
digitalWrite(led[hidup], HIGH);
delay(100);
}
delay(100);
for (int mati = 3; mati >= 0; mati--)
{
digitalWrite(led[mati], LOW);
delay(100);
}
delay(100);
for (int hidup = 4; hidup <= 7; hidup++)
{
digitalWrite(led[hidup], HIGH);
delay(100);
}
delay(100);
for (int mati = 4; mati <= 7; mati++)
{
digitalWrite(led[mati], LOW);
delay(100);
}
}
File Percobaan Proteus Klik disini
File Program Arduino Klik disini
Video Simulasi Klik disini
Library Arduino Klik disini
Datasheet Arduino Klik disini
HTML Klik disini
Tidak ada komentar:
Posting Komentar