#include <Servo.h>
Servo myservo;
int pos = 0;
const int FloatSwitch = 3;
const int ledPin = 2;
int buttonState = 0;
int Sangle=90;
int Eangle=180;
int tries=1;
void setup()
{
myservo.attach(9);
pinMode(ledPin, OUTPUT);
pinMode(FloatSwitch, INPUT);
}
void loop()
{
}
I have my arduino on a board with 5 v and then have the servo motor hooked to 3AAA batteries (4.5V). I have connected the grounds. For some reason the servo motor moves when it is attached to pin 9. Without my sending any commands, this code is attached. The power light on the board is not flickering at all. There is nothing else on the boards that could explain this. I never had this issue when using a servo controller and thought that the arudino could handle a small servo without any load (just using the servo.h and arduino capabilities). I guess not. Hopefully, someone has a good explanation for me,lol. Thanks in advance.