The voltage into the Arduino is a 10K potentiometer connected between 5V and Ground Power pins on the Arduino header. The wiper of the pot is connected to one of pins on the Analog In header. (Arbitrarily A1 because students use -- and damage A0). I hope a schematic is not needed of this simple input.
I am running MacOS 11.6, with Arduino 1.8.13. Another Mac I tested is MacOS 10.14.6 with Arduino 1.8.13. I have also tried this experiment with Windows 10, but do not have the information for the "lab computers."
Everything compiles and uploads with no errors, even in verbose mode.
Sample code below illustrates the problem; Arduino specifics are in comments.
Thank you!
/*
FABE 5160
Uno vs Leonardo Troubleshooting
Read an analog input from a 0-5V potentiometer and display the number on the serial monitor
This count should be between 0 and 1024 for a 0V to 5V input.
C Gecik
7 Nov 2020 Rev 0.0
*/
//Declare and initialize all variables and constants
//pin variables
int inputPin = A1; //Vout from a 10K potentiometer connects to an analog input
//The choices here are A0, A1, A2, A3, A4 or A5
int inputValue = 0; // variable to store the voltage reading from the potentiometer
//constants
int delayTime = 100; //the time in milliseconds between each iteration of the loop which samples and displays
void setup() {
}
void loop() {
//Read and store analog voltage input
inputValue = analogRead(inputPin);
// send to monitor the ADC count
Serial.print("ADC Count: ");
Serial.println(inputValue);
delay(delayTime); //time delay between successive samples
}
/*
BN: Arduino Leonardo
VID: 2341
PID: 8036
SN: (null)
Purchased in 2018, used with lots of students
WORKS!
BN: Arduino Uno
VID: 2341
PID: 0043
SN: 85033313137351A0E082
Purchased October 2021, never used successfully
NOTHING DISPLAYS ON THE SERIAL MONITOR!
*/