Go Down

Topic: Servo Help (Read 382 times) previous topic - next topic

Steve Virgo

Hi,
As you may of seen I have started a OMSI dashboard.

My problem at the moment is I cannot even get a server to sweep.
I wire up the servo correctly and it just makes a little vibratey noise and
nothing happens.

Please help,
Steve
------------
Youtube: http://youtube.com/virgocomputing
Current Projects: Using an Arduino UNO To Control a Model Railway's Points and Signa

JimboZA

Quote
I wire up the servo correctly and it just makes a little vibratey noise and
nothing happens.


C'mon Steve.... you'll have to do better than that  8)

Circuit.... code....
Arduino ethernet server here.... http://jimboza.gotdns.com:8085/

No PMs for help please

Steve Virgo

I dont get you????.

I think it may be my servo, I have checked the whole system, The whole code,
Nothing seems to work.

Is it me being dumb and not working something out?
------------
Youtube: http://youtube.com/virgocomputing
Current Projects: Using an Arduino UNO To Control a Model Railway's Points and Signa

JimboZA

Quote
Is it me being dumb and not working something out?


Well nobody can tell unless you post the code and the circuit.....
Arduino ethernet server here.... http://jimboza.gotdns.com:8085/

No PMs for help please

Steve Virgo




// Sweep
// by BARRAGAN <http://barraganstudio.com>
// This example code is in the public domain.


#include <Servo.h>

Servo myservo;  // create servo object to control a servo
                // a maximum of eight servo objects can be created

int pos = 0;    // variable to store the servo position

void setup()
{
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object
}


void loop()
{
  for(pos = 0; pos < 180; pos += 1)  // goes from 0 degrees to 180 degrees
  {                                  // in steps of 1 degree
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
  for(pos = 180; pos>=1; pos-=1)     // goes from 180 degrees to 0 degrees
  {                               
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
}
------------
Youtube: http://youtube.com/virgocomputing
Current Projects: Using an Arduino UNO To Control a Model Railway's Points and Signa

JimboZA

Ok, well assuming it is actually connected correctly  8), it might be that your servo is unable to get enough current through the Arduino.

I'd hook the servo up to its own power, not through the Arduino, like in my Fritzing pic below. Check the servo maker's details though, to check what voltage it needs.
Arduino ethernet server here.... http://jimboza.gotdns.com:8085/

No PMs for help please

Go Up