
keyestudio
www.keyestudio.com
28
val=digitalRead(inpin);// read the level value of pin 7 and assign if to val
if(val==LOW)// check if the button is pressed, if yes, turn on the LED
{ digitalWrite(ledpin,LOW);}
else
{ digitalWrite(ledpin,HIGH);}
}
//////////////////////////////////////////////////////////
Test Result
When the button is pressed, LED is on, otherwise, LED remains off. In this way, the button
controlled LED experiment is completed. The simple principle of this experiment is widely used
in a variety of circuit and electric appliances. You can easily come across it in your daily life. One
typical example is when you press a certain key on your phone, the backlight will be on.
*******************************************************************************
Project 7: Active Buzzer
Introduction
Active buzzer is widely used as a sound making element on computer, printer, alarm, electronic
toy, telephone, timer and more. It has an inner vibration source. Simply connect it with 5V power
supply, it can buzz continuously.
Summary of Contents for KS0077
Page 1: ...keyestudio www keyestudio com 1 Super Learning Kit for Arduino...
Page 14: ...keyestudio www keyestudio com 14 Connection for UNO R3 Connection for 2560 R3...
Page 32: ...keyestudio www keyestudio com 32 Connection for 2560 R3...
Page 42: ...keyestudio www keyestudio com 42 Connection for MEGA 2560...
Page 45: ...keyestudio www keyestudio com 45 Connection for UNO R3 Connection for 2560 R3...
Page 59: ...keyestudio www keyestudio com 59 Connection for 2560 R3...
Page 66: ...keyestudio www keyestudio com 66 Connection for 2560 R3...
Page 72: ...keyestudio www keyestudio com 72 Manual for LED Segment Display Connection for UNO R3...
Page 85: ...keyestudio www keyestudio com 85 8 bit Connection Method Connection for UNO R3...
Page 94: ...keyestudio www keyestudio com 94 Connection for 2560 R3 Connect the motor to digital pin 9...