Error in code

we wrote this code to rotate the servo through a potentiometer :

#include <Servo.h>
#include <stdio.h>

Servo myservo;
int potpin = 3; //pot l direction
int valOfPot1 = 0 ;

void rotate(){

valOfPot1 = analogRead(potpin); //read value from pot direction
valOfPot1 = map(valOfPot1,0,1023,5,175); //map it(mn l 5 lal 175 ) mchen ma yrj l servo
myservo.write(valOfPot1); //write to servo
delay(30);
}

But we've got this error :

core.a(main.cpp.o): In function main': C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/main.cpp:11: undefined reference to setup'
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/main.cpp:14: undefined reference to `loop'

Any help please? :slight_smile:

C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/main.cpp:11: undefined reference to setup' C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/main.cpp:14: undefined reference to loop'

Do you see anything called "setup"?
Do you see anything called "loop"?