Pages: 1 ... 5 6 [7] 8 9   Go Down
Author Topic: Need some help for a science project.  (Read 9704 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 1
Posts: 62
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is all so confusing, but it has to get done...
Logged

Robots are cool.

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12630
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is all so confusing, but it has to get done...

After seven pages I've lost track of what you have got working, and where you're stuck.

What's the current problem?
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Offline Offline
Jr. Member
**
Karma: 1
Posts: 62
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It's cool. Here's where I am right now... I built the hand itself, but I need to get multiple servo's running at once, so I can tie the strings on the fingers into the holes in the servo motor and I'm having some trouble getting 1 to run on external power.
Logged

Robots are cool.

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

I'm having some trouble getting 1 to run on external power.

Here's my suggestion then:

1- Put DuaneB's multi servo sketch aside for now.
2- Reload sweep, which I think u said was working before?
3- Carefully check the wiring* of the one servo, your Fritzing pic showed you had the red and black confused. Keep the Arduino powered from the PC...
4- Run sweep to verify that the servo runs from external power.
5- Then and only then, edit sweep along the lines of my suggestion many posts back, to have a second servo ("myOtherServo" for instance) on another pin and run that new sketch to verify two servos

Then we'll talk some more...

* wiring is battery +ve to servo red, -ve to servo black and also Arduino ground, yellow / orange to Arduino pin to which servo is attached in sketch. Check the voltage is what the servo needs, probably 4.8 to 6, not the 9 you were using
Logged

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

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

Something along the lines of the Fritz attached


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

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

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

And two would be thus....

Make sure the yellow wires go to the pins you attach the servos to in the skecth


* two servo.jpg (973.47 KB, 2838x1728 - viewed 24 times.)
Logged

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

Offline Offline
Jr. Member
**
Karma: 1
Posts: 62
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Will a battery holder that can hold 6 batteries work with only 4 inside?
Logged

Robots are cool.

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 309
Posts: 26527
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Not normally, no
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Jr. Member
**
Karma: 1
Posts: 62
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks. It works fine with 6.  smiley
Logged

Robots are cool.

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17303
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Will a battery holder that can hold 6 batteries work with only 4 inside?

Only if you jumper out the two empty spaces with a soldered jumper wires, or find solid brass rods of the same size as the batteries to use as 'dummy cells'.

Lefty
Logged

Offline Offline
Jr. Member
**
Karma: 1
Posts: 62
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hmmm... I got one servo running from external power on pin 9, but the code I tried to write (newbie programmer here) doesn't seem to work. I looked at the reference library on the Arduino website too.
Logged

Robots are cool.

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 309
Posts: 26527
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
, but the code I tried to write (newbie programmer here) doesn't seem to work
That's sad.
(Hint)
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Jr. Member
**
Karma: 1
Posts: 62
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

#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

Robots are cool.

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 309
Posts: 26527
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK, so what does it do that it shouldn't and what doesn't it do that it should?
Code tags would be good too.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Jr. Member
**
Karma: 1
Posts: 62
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It doesn't move at all when I upload it.
Logged

Robots are cool.

Pages: 1 ... 5 6 [7] 8 9   Go Up
Jump to: