Devices & Components
Arduino Uno Rev3
Breadboard (generic)
Jumper wires (generic)
Rotary potentiometer (generic)
Software & Tools
Arduino IDE
Project description
Code
Sketch
arduino
1/* 2 Analog Read Serial 3 Reads an analog input on pin 0. 4 prints the result to the Serial Monitor. 5 Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground. 6*/ 7 8// the setup routine runs once when you press reset: 9void setup() { 10 // initialize serial communication at 9600 bits per second: 11 Serial.begin(9600); 12} 13 14// the loop routine runs over and over again forever: 15void loop() { 16 // read the input on analog pin 0: 17 int sensorValue = analogRead(A0); 18 // print out the value you read: 19 Serial.println(sensorValue); 20 delay(1); // delay in between reads for stability 21}
Downloadable files
Schematic Diagram
Schematic Diagram

Breadboad Diagram
Breadboad Diagram

Comments
Only logged in users can leave comments