Pages: [1]   Go Down
Author Topic: Multiple servo motor with using arduino code!  (Read 1293 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'd like to use an arduino to control 2 servos.  I have found a single servo motor code but i coudnt find it multiple servo code.

i tryin to make a 4 different angle (0, 90, 180, 360 dgrees) with one of servo motor and other servo is 8 different angles  (0, 45, 90, 135, 180, 225, 270, 360 dgrees).

Please help me to make the code plesase.


Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

 
this is the i made a sing servo motor code.

 // Controlling a servo position using a potentiometer (variable resistor)
// by Michal Rinott <http://people.interaction-ivrea.it/m.rinott>

#include <Servo.h>
 
Servo myservo;  // create servo object to control a servo
 
 
void setup()
{
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object
}
 
void loop()
{
   myservo.write(10);                  // sets the servo position according to the scaled value
  delay(1000);                           // waits for the servo to get there
     myservo.write(90);                  // sets the servo position according to the scaled value
  delay(1000);                           // waits for the servo to get there
     myservo.write(180);                  // sets the servo position according to the scaled value
  delay(1000);                           // waits for the servo to get there
     myservo.write(360);                  // sets the servo position according to the scaled value
  delay(1000);                           // waits for the servo to get there
}

Logged

London
Offline Offline
Faraday Member
**
Karma: 8
Posts: 6240
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Standard hobby servos will not rotate more than 180 degrees (many will rotate a somewhat less than this)

What are you trying to make?
« Last Edit: April 14, 2010, 10:37:13 pm by mem » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i tryin to make a toy for uni project.

do you know about any coding stuff?

connects to the 2 servos into arduino
Logged

London
Offline Offline
Faraday Member
**
Karma: 8
Posts: 6240
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

if you need 360 degree rotation then you may be better of using a stepper motor.

Can you describe what you want this toy to do?
Logged

UK
Offline Offline
Faraday Member
**
Karma: 16
Posts: 2883
Gorm deficient
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I have found a single servo motor code but i coudnt find it multiple servo code.

Really? Did you look in the Playground?
Logged

Per Arduino ad Astra

0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi God members, i am doing same project with him. And we want 1 servo to spin at random angles (0,45, 90,135,180) for 1-4s, and another servo to spin at (0,45,90,135,180)
Logged

Pages: [1]   Go Up
Jump to: