TroubleshootingArduino

Attempting to drive SER0047 with an Arduino

userHead Glenn.Patton 2023-06-22 02:13:49 128 Views2 Replies

Hi All,

I am attempting to drive SER0047 servo motor with an Arduino the code is:

#include <Servo.h>

 

Servo myServo;

int servoPin = 2;

uint16_t i = 0;

 

void setup() {  // put your setup code here, to run once:

myServo.attach(servoPin);

pinMode(LED_BUILTIN, OUTPUT);

}

 

void loop() {

 // put your main code here, to run repeatedly:

  //HERE:

 i = 0;

  for(i = 1; i <= 180; i++)

  {

   myServo.write(i);

   delay(15);

   }  

for(i = 180; i >= 1; i--)

  {  

   myServo.write(i);  

   delay(15);

 }

//goto HERE;

}

 

I have verified the servos with a pulse generator so they are working. Is the issue with trying to use the servo library? 

Any ideas? 

 

Thanks Glenn 

 

2023-06-24 17:48:34

Fixed the problem due to wires at arduino being reversed!!

userHeadPic Glenn.Patton
2023-06-22 02:40:02

Update: The servo wouldn't start rotation unless given manual help and even then in one direction only..?

userHeadPic Glenn.Patton