void setup()
{
pinMode(12,OUTPUT);// Connect LED1 to pin number 12
pinMode(11,OUTPUT); // Connect LED1 to pin number 11
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop()
{
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
// print out the value you read:
Serial.println(sensorValue);
if(sensorValue < 512)
{
digitalWrite(12, HIGH);// Turn ON LED1
}
else
{
digitalWrite(11, HIGH);// Turn ON LED2
}
}