// robotics blocks - Learn button
int temp;
float v;
void setup() {
Serial.begin(9600);
temp=31;
}
void loop() {
// read the state of the pushbutton value:
v = analogRead(A2);
if (v>500 )
{
Serial.print("bigger then 2.5v ");
}
if ( v==0 )
{
Serial.print(" 0 volt ");
}
if ( v<500)
{
Serial.print(" lower then 2.5 V ");
}
Serial.println(v/1023*5); // convert to volt
delay(1000); // wait 1 sec (1 sec = 1000 ms)
}