Pages: [1]   Go Down
Author Topic: Servo Help  (Read 356 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 23
Using an Arduino UNO To Control a Model Railway's Points and Signals
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

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

Johannesburg. UTC+2
Online Online
Faraday Member
**
Karma: 108
Posts: 4753
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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  smiley-cool

Circuit.... code....
Logged

The Elders of the Internet know who I am
I'm on LinkedIn: http://www.linkedin.com/in/jimbrownza

Offline Offline
Newbie
*
Karma: 0
Posts: 23
Using an Arduino UNO To Control a Model Railway's Points and Signals
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

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

Johannesburg. UTC+2
Online Online
Faraday Member
**
Karma: 108
Posts: 4753
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Well nobody can tell unless you post the code and the circuit.....
Logged

The Elders of the Internet know who I am
I'm on LinkedIn: http://www.linkedin.com/in/jimbrownza

Offline Offline
Newbie
*
Karma: 0
Posts: 23
Using an Arduino UNO To Control a Model Railway's Points and Signals
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset




// 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
  }
}
Logged

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

Johannesburg. UTC+2
Online Online
Faraday Member
**
Karma: 108
Posts: 4753
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, well assuming it is actually connected correctly  smiley-cool, 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.


* one servo.jpg (889.78 KB, 2838x1473 - viewed 26 times.)
Logged

The Elders of the Internet know who I am
I'm on LinkedIn: http://www.linkedin.com/in/jimbrownza

Pages: [1]   Go Up
Jump to: