Instructions

IDUINO for maker’s life
14 www.openplatform.cc
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
{
digitalWrite (Led, LOW);
}
}
********Code End********
3.2 Example 2
This example shows you the Analog pin function, connect this module as below picture,
and upload the code.
Then open the Serial monitor, you can see some number between 0 to 1023. And now if
you make some high or low voice, the number is changing.