Servo Motor coding error messages

PLEASE HELP - I HAVE TRIED SO MANY TIMES AND THIS IS THE LATEST ERROR MESSAGE:

Arduino: 1.8.15 (Windows 7), Board: "Arduino Uno"

Sketch uses 3400 bytes (10%) of program storage space. Maximum is 32256 bytes.

Global variables use 251 bytes (12%) of dynamic memory, leaving 1797 bytes for local variables. Maximum is 2048 bytes.

An error occurred while uploading the sketch

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

This is the code i input:

#include <Servo.h>
Servo myServo;
int const potPin = A0;
int potVal;
int angle;

void setup() {
  myServo.attach(9);
  Serial.begin(9600);
}

void loop() {
  potVal = analogRead(potPin);
  Serial.print("potVal: ");
  Serial.print(potVal);

 angle = map(potVal, 0, 1023, 0, 179);
 Serial.print(", angle: ");
 Serial.println(angle);

 myServo.write(angle);
 delay(15);
}

I tried uploading a pic of my wiring set-up but i can't attach one.

Do you have the Servo library installed ?

seems the compilation went fine but the upload failed.

did you enable the verbose output?

what board did you choose? is it the correct one?
what Serial port did you choose? is it the correct one?

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.