Percobaan-11


Percobaan-11

Input – Output (I/O)

Anggota kelompok

Nama : Alfan Dwi Cahyo                NIM : 15.360.0002

Nama : Achmad Syaiful Faried    NIM : 15.360.0003



Tujuan : Meghidupkan dan mematikan LED dengan 1 push button menggunakan arduino uno

Program :

int button= 2;

int nilaitombol;

int count;

 int led= 13;

 void setup(){

pinMode(button, INPUT);

pinMode(led, OUTPUT);

}

void loop(){

nilaitombol= digitalRead(button);

 if(nilaitombol == 1){

count++;

delay(300);

if(count==1){

digitalWrite(led, HIGH);

}

if(count==2){

digitalWrite(led, LOW);

count=0;

}

}

}



Proyek :







Komentar

Postingan populer dari blog ini

TUGAS_4 RANGKAIAN MOTOR LISTRIK PUTARAN KANAN/KIRI (FORWARD/REVERSE)

TUGAS_6 RANGKAIAN TIGA BUAH LAMPU SECARA BERGANTIAN (TRAFIGHLIGHT)

TUGAS_8 CLOCK PULSE BIT