0% found this document useful (0 votes)
13 views1 page

PDF Maker 1729777174424

The document contains an Arduino code that controls two LEDs, two buttons, and a buzzer. When the first button is pressed, a red LED lights up for 3 seconds, followed by a buzzer sound. When the second button is pressed, a yellow LED lights up for 3 seconds, followed by a different buzzer sound, with the red LED turning off.

Uploaded by

Rizal mlg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views1 page

PDF Maker 1729777174424

The document contains an Arduino code that controls two LEDs, two buttons, and a buzzer. When the first button is pressed, a red LED lights up for 3 seconds, followed by a buzzer sound. When the second button is pressed, a yellow LED lights up for 3 seconds, followed by a different buzzer sound, with the red LED turning off.

Uploaded by

Rizal mlg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

int led_merah=13;

int tombol=10;
int led_kuning=6;
int tombol2=4;
int buzzer=8;
void setup() {
pinMode(led_merah, OUTPUT);
pinMode(tombol, INPUT);
pinMode(led_kuning, OUTPUT);
pinMode(tombol2, INPUT);
pinMode(buzzer, OUTPUT);
digitalWrite(tombol, HIGH);
digitalWrite(tombol2, HIGH);

}
void loop() {
if(digitalRead(tombol) == LOW)
{
digitalWrite(led_merah, HIGH);
delay(3000);
digitalWrite(led_merah,LOW);
digitalWrite(buzzer, HIGH);
tone(buzzer, 1000);
delay(2000);
noTone(buzzer);
digitalWrite(led_kuning, LOW);
}
if(digitalRead(tombol2)==LOW)
{
digitalWrite(led_kuning, HIGH);
delay(3000);
digitalWrite(led_kuning, LOW);
digitalWrite(buzzer, HIGH);
tone(buzzer, 3000);
delay(2000);
noTone(buzzer);
digitalWrite(led_merah, LOW);
}
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy