Hi, I started to program with an arduino since few days.
and today, i received a message error on a simple program that runs a servo.
I don’t understand why there are errors, so i post here ^^
this is the program code :
#include <Servo.h>
Servo myservo;
int ori = 0;
void setup()
{
myservo.attach(10);
}
void loop()
{
if( 15<(abs( analogRead(A1) - analogRead(A2))) )
{
ori += map((analogRead(A1)-analogRead(A2)),0,1023,0,360);
myservo.write(ori);
}
}
and this is the error messages :
orientation_auto.ino: In function 'void setup()':
orientation_auto:6: error: redefinition of 'void setup()'
sketch_may01a:3: error: 'void setup()' previously defined here
orientation_auto.ino: In function 'void loop()':
orientation_auto:11: error: redefinition of 'void loop()'
sketch_may01a:8: error: 'void loop()' previously defined here
why declare a variable redefine the main function x) ?
sorry again if there are english errors
Balafre