Tugas Pendahuluan Percobaan 1
Percobaan 1 Kondisi 4
Kondisi awal Led mati lalu hidup secara bergantian Led 1,2,3,4 selanjutnya 5,6,7,8 berulang
2. Gambar Rangkaian Simulasi [KEMBALI]
int led[] = {2, 3, 4, 5, 6, 7, 8, 9};
void setup() {
for (int i = 0; i <= 8; i++)
{
pinMode (led[i], OUTPUT);
}
}
void loop() {
for (int hidup = 0; hidup <= 3; hidup++) {
digitalWrite(led[hidup], HIGH);
delay(500);
}
delay(2000);
for (int hidup = 4; hidup <= 7; hidup++) {
digitalWrite(led[hidup], HIGH);
delay(500);
}
// delay(500);
for (int mati = 7; mati >= 0; mati--) {
digitalWrite(led[mati], LOW);
delay(500);
}
}
Video Simulasi Download
Listing Program Download
Flowchart Download
Tidak ada komentar:
Posting Komentar