Notifications
Clear all

[Sticky] Introduce Yourself  

Page 64 / 64

TechPriest88
(@techpriest88)
New Member
Joined: 2 weeks ago
Posts: 2
 

Hi,

 

 My name is Josh. I am a school science technician in the UK and I originally studied a Chemistry degree. I am fascinated with Science especially practical applications so one day I thought about how to make a ultrasonic device for one of the science lessons on Ultrasound and I came across the Arduino board, the ultrasonic component, bread board and some wires on a Youtube video. I ordered the components online, assembled them and found I enjoyed making the machine so I decided to order more Arduino boards and I made a motion sensor, a Electromagnetic field detector and another ultrasonic detector. I found a youtube video from Drone Bot Workshop on how to configure a Waveshare 1.5" OLED display using Arduino and I found it helpful and I seek to know more about Arduino, even taking an online Arduino course on Udemy. Nice to meet you all.


ReplyQuote
CodeD
(@coded)
Active Member
Joined: 3 days ago
Posts: 6
 

Hi,

My name's Cody. I'm a college student in the U.S.; I'm a Digital Media Design major.
Currently I'm working on a project in my Interactive Design class that requires 2-3 servo
motors. It's with an Arduino Uno super starter kit, and I'm having a difficult time with it.
I can get one servo to work fine, but I just can't figure out how to get 2 or more working.
Any suggestions? Resources?

Thanks.

ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 2 years ago
Posts: 1002
 

@coded

Have you watched the videos here that Bill produced on using servos?  He has at least two that I recall and if you were to follow along using those as a teaching too, then you should be able to adapt your own code to get it working.

SteveG


ReplyQuote
robotBuilder
(@robotbuilder)
Honorable Member
Joined: 2 years ago
Posts: 741
 

@coded

Well you have to kind of supply a little more detail?

"My circuit doesn't work any suggestions" without the circuit and the code in question makes it impossible to answer.

 

 


ReplyQuote
CodeD
(@coded)
Active Member
Joined: 3 days ago
Posts: 6
 

@robotbuilder and @codecage

I am trying to figure out how to modify the Sweep sketch code so I can use 2 servo motors with my Arduino board. Also I'm not sure how to wire 2 servo motors to the Arduino board. The link to the Sweep sketch is included below:

https://www.arduino.cc/en/Tutorial/LibraryExamples/Sweep


ReplyQuote
CodeD
(@coded)
Active Member
Joined: 3 days ago
Posts: 6
 

@codecage

I have seen the videos about Servo motors that Bill has made, but I am new to electronics so I don't really understand them. Thanks anyway.

 

 


ReplyQuote
JoeLyddon
(@joelyddon)
Reputable Member
Joined: 2 years ago
Posts: 346
 
Posted by: @coded

@codecage

I have seen the videos about Servo motors that Bill has made, but I am new to electronics so I don't really understand them. Thanks anyway.

 

 

May I suggest that you watch them over & over again...  studying each component (module) for what it does.  For example the power going to the servos MUST come from another source; NOT from the Arduino, etc. ...  A separate source...  Each servo is controlled separately from the Arduino to an interface that will talk to the Servos...   Watch those videos again and again paying attention to the REASON for the modules used to get to  and control the servos...   Read the accompanying article for possibly more information.

 

That's about all I can suggest...  You have to study each module to understand the building blocks used in the circuit.

 

I hope this gets you on the right track...

 

Good Luck,

Joe

 

Have Fun,
Joe Lyddon

www.woodworkstuff.net


ReplyQuote
JoeLyddon
(@joelyddon)
Reputable Member
Joined: 2 years ago
Posts: 346
 

Cody,

 

Look on page 28...  for Paul McWhorter...  He has several videos taking you from the VERY BEGINNING all the way through various topics, including Servos and Stepper motors...

Take the time to watch & study all of his videos...  sounds like you have the tools you need to get going with his great education!

Here is Page 28:  https://forum.dronebotworkshop.com/introductions/introduce-yourself/paged/28/

 

Go for it,

Joe

 

This post was modified 1 day ago by JoeLyddon

Have Fun,
Joe Lyddon

www.woodworkstuff.net


ReplyQuote
robotBuilder
(@robotbuilder)
Honorable Member
Joined: 2 years ago
Posts: 741
 

@joelyddon

I think he just wants a working circuit and code without all that study. There are examples on the web.

https://www.instructables.com/Arduino-Multiple-Servo-Control-With-Arduino/

 


ReplyQuote
JoeLyddon
(@joelyddon)
Reputable Member
Joined: 2 years ago
Posts: 346
 

@robotbuilder

Yep, looks like it...  I tried...

Maybe he should be googleing:  What is a resistor, capacitor, IC,  electronics, etc.

(???????)

 

Have Fun,
Joe Lyddon

www.woodworkstuff.net


ReplyQuote
CodeD
(@coded)
Active Member
Joined: 3 days ago
Posts: 6
 

@joelyddon

Thank you. After I'm done with my final project I will take a look at the resources you shared with me. Right now I'm crunched for time 


ReplyQuote
CodeD
(@coded)
Active Member
Joined: 3 days ago
Posts: 6
 

@robotbuilder

Thank you, this is more of what I was looking for.


ReplyQuote
barefoot_engineer
(@barefoot_engineer)
New Member
Joined: 6 months ago
Posts: 4
 

@coded,

You may have figured something out already, but I got two servos to work using the code below. Basically, you need to define each servo as a separate object. 

Hope this helps. 

Eli

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

modified 8 Nov 2013
by Scott Fitzgerald
http://www.arduino.cc/en/Tutorial/Sweep
*/

#include <Servo.h>

Servo myservo1;
Servo myservo2; // create servo object to control a servo
// twelve servo objects can be created on most boards

int pos1 = 0;
int pos2 = 0;// variable to store the servo position

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

void loop() {
for (pos1 = 0; pos1 <= 180; pos1 += 1) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
myservo1.write(pos1); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}

for (pos1 = 180; pos1 >= 0; pos1 -= 1) { // goes from 180 degrees to 0 degrees
myservo1.write(pos1); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}

for (pos2 = 0; pos2 <= 180; pos2 += 1) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
myservo2.write(pos2); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}

for (pos2 = 180; pos2 >= 0; pos2 -= 1) { // goes from 180 degrees to 0 degrees
myservo2.write(pos2); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}


ReplyQuote
JoeLyddon
(@joelyddon)
Reputable Member
Joined: 2 years ago
Posts: 346
 

@barefoot_engineer

Don't you think that circuit is stretching it a little to power 2-3 servos?

 

 

Have Fun,
Joe Lyddon

www.woodworkstuff.net


ReplyQuote
robotBuilder
(@robotbuilder)
Honorable Member
Joined: 2 years ago
Posts: 741
 

@barefoot_engineer

If you are using the Arduino IDE try,  right mouse button, Select All, Copy as HTML, then select {;} from the top bar in the forum post and insert code between a pair of <p></p>

 

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

modified 8 Nov 2013
by Scott Fitzgerald
 http://www.arduino.cc/en/Tutorial/Sweep 
*/

#include <Servo.h>

Servo myservo1;
Servo myservo2; // create servo object to control a servo
// twelve servo objects can be created on most boards

int pos1 = 0;
int pos2 = 0;// variable to store the servo position

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

void loop() {
  for (pos1 = 0; pos1 <= 180; pos1 += 1) { // goes from 0 degrees to 180 degrees
    // in steps of 1 degree
    myservo1.write(pos1); // tell servo to go to position in variable 'pos'
    delay(15); // waits 15ms for the servo to reach the position
  }

  for (pos1 = 180; pos1 >= 0; pos1 -= 1) { // goes from 180 degrees to 0 degrees
    myservo1.write(pos1); // tell servo to go to position in variable 'pos'
    delay(15); // waits 15ms for the servo to reach the position
  }

  for (pos2 = 0; pos2 <= 180; pos2 += 1) { // goes from 0 degrees to 180 degrees
    // in steps of 1 degree
    myservo2.write(pos2); // tell servo to go to position in variable 'pos'
    delay(15); // waits 15ms for the servo to reach the position
  }

  for (pos2 = 180; pos2 >= 0; pos2 -= 1) { // goes from 180 degrees to 0 degrees
    myservo2.write(pos2); // tell servo to go to position in variable 'pos'
    delay(15); // waits 15ms for the servo to reach the position
  }
}

 

 


ReplyQuote
Page 64 / 64