Instructions
IDUINO for maker’s life
www.openplatform.cc 19
Then turn the variable resistor until the LED12 turns off. Now you can handclap or make
a sound, you will see the LED12 turns on.
Code for Example1
********Code begin********
int Led = 12 ;// define LED Interface
int buttonpin = 7; // define D0 Sensor Interface
int val = 0;// define numeric variables val
void setup ()
{
pinMode (Led, OUTPUT) ;// define LED as output interface
pinMode (buttonpin, INPUT) ;// output interface D0 is defined sensor
}
void loop ()
{
val = digitalRead(buttonpin);//
if (val == HIGH) //
{
digitalWrite (Led, HIGH);
}
else
{