Instructions
IDUINO for maker’s life
www.openplatform.cc 15
Code for Example2
********Code begin********
int sensorPin = A5; // select the input pin for the potentiometer
void setup ()
{
Serial.begin (9600);
}
void loop ()
{
sensorValue = analogRead (sensorPin);
delay (500);
Serial.println (sensorValue, DEC);
}
********Code End********
3.3 Example 3
In this example we try to combine digital pin and analog pin together to control two LED
lights, connection and code as below.