/* Analog input, serial output Reads an analog input pin an prints the results to the serial monitor. The circuit: * potentiometer connected to analog pin 1. Center pin of the potentiometer goes to the analog pin. side pins of the potentiometer go to +5V and ground created 19 April 2018 by Terry Sturtevant This example code is in the public domain. */ // These constants won't change. They're used to give names // to the pins used: const int analogInPin = A1; // Analog input pin that the potentiometer is attached to int sensorValue = 0; // value read from the pot void setup() { // initialize serial communications at 9600 bps: Serial.begin(9600); } void loop() { // read the analog in value: sensorValue = analogRead(analogInPin); // print the results to the serial monitor: Serial.print("sensor = "); Serial.println(sensorValue); // wait 2 milliseconds before the next loop // after the last reading: delay(1000); }