Analog read error


I keep on getting the following error

"Sketch uses 2,002 bytes (6%) of program storage space. Maximum is 32,256 bytes. Global variables use 184 bytes (8%) of dynamic memory, leaving 1,864 bytes for local variables. Maximum is 2,048 bytes. Error opening serial port 'COM6'. (Port busy) avrdude: stk500_recv(): programmer is not responding"

what could be the problem

first time programmer

That means that your code complied, but the PC can't communicate with the Arduino. Verify that you have selected the right comm port. for trouble shooting comm problems.

The PC/laptop can’t connect to the Arduino.

Close the serial window, and look if the right board and port are selected in the IDE (Tools tab).

What does this have to do with analogRead()?

PaulS: What does this have to do with analogRead()?

Yes about that try to read voltage using potentiometer