Hardware Reference
In-Depth Information
Serial.begin( 9600 );
}
void loop ()
{
val = analogRead(pot);
Serial.print("A0=");
Serial.println(val);
delay( 500 );
}
Save this code, called PotDemo .
3.4.1.3 Testing
Compile and deploy the program to the board. To see analog input value, open Serial Mon-
itor. It can get it by clicking menu Tools -> Serial Monitor.
Try to change value on Potentiometer and see it on Serial Monitor. A sample output can be
seen in Figure below.
Search WWH ::




Custom Search