Go Down

Topic: Ardunio and a Transmitter? (Read 1 time) previous topic - next topic

Ardcino

Hello everyone,

I am new to robotics and I purchase everything I needed to make my first rover via my 3d printer.

Anyways I have a Uno R3, SkyFky 6 Chan radio with a receiver and 14 servo's.

I want to be able to connect the radio to the ardunio then let the ardunio talk to my receiver with continuous rotation servos hooked to the receiver and not the board it self.


Is this possible? 


PaulS

Quote
I want to be able to connect the radio to the ardunio then let the ardunio talk to my receiver
You want the Arduino to tell the radio bedtime stories?

The art of getting good answers lies in asking good questions.

zoomkat

Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0

Ardcino

Thank you everyone.

So far with AudoDesk Curicit 321D I have 2 servos running with 4 double a batteries.

Now I just gotta get the other 2 servo's going using this code.

#include <Servo.h>

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

Servo myservo2;  // create servo2 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(8);  // attaches the servo on pin 8 to the servo object
  myservo2.attach(12);  // attaches the servo on pin 10 to the servo object
}

void loop()
{
  for(pos = 0; pos < 160; pos += 1)  // goes from 0 degrees to 160 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 = 0; pos < 120; pos += 1)  // goes from 0 degrees to 120 degrees
  {                                  // in steps of 1 degree
    myservo2.write(pos);              // tell servo2 to go to position in variable 'pos'
    delay(25);                        // waits 25ms for the servo to reach the position
  }


  for(pos = 160; pos>=1; pos-=1)     // goes from 160 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
  }


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

zoomkat

Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0

PaulS

Quote
#7 below:
Yep. Using that smiley face pin to drive a servo is just not going to work.
The art of getting good answers lies in asking good questions.

Ardcino

This is my new code, and it works, How ever I am looking to make them rotate 360 not 180.



My code is here.





</>
/* 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 MyServo;  // create servo object to control a servo
                // twelve servo objects can be created on most boards
Servo Four;  // create servo object to control a servo
                // twelve servo objects can be created on most boards
Servo Three;  // create servo object to control a servo
                // twelve servo objects can be created on most boards
Servo One;  // create servo object to control a servo
                // twelve servo objects can be created on most boards

 
int pos = 0;    // variable to store the servo position
 
void setup()
{
  MyServo.attach(7);  // attaches the servo on pin 7 to the servo object
  Four.attach(2);  // attaches the servo on pin 2 to the servo object
  Three.attach(4);  // attaches the servo on pin 4 to the servo object
  One.attach(8);  // attaches the servo on pin 8 to the servo object
}
 
void loop()
{
  for(pos = 0; pos <= 90; 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'
    Four.write(pos);              // tell servo to go to position in variable 'pos'
    Three.write(pos);              // tell servo to go to position in variable 'pos'
    One.write(pos);              // tell servo to go to position in variable 'pos'
    delay(10);                       // waits 15ms for the servo to reach the position
  }
  for(pos = 90; pos>=0; pos-=1)     // goes from 180 degrees to 0 degrees
  {           
    MyServo.write(pos);              // tell servo to go to position in variable 'pos'
    Four.write(pos);              // tell servo to go to position in variable 'pos'
    Three.write(pos);              // tell servo to go to position in variable 'pos'
    One.write(pos);              // tell servo to go to position in variable 'pos'
    delay(10);                       // waits 15ms for the servo to reach the position
  }
}
</>

DuaneDegn

#7
Nov 01, 2015, 09:42 pm Last Edit: Nov 01, 2015, 09:43 pm by DuaneDegn
"</>" is the icon for inserting code not the tag itself. The tags are:

 [code]

// your code here

[/code]

How ever I am looking to make them rotate 360 not 180.
Not many hobby servos will rotate 360 degrees. Earlier you said you were using continuous rotation (CR) servos but one can't control the position of CR servos, only their speed.

Dynamixel's AX-12A controllers allow one to position the output of a range of 300 degrees and can also be used to continuously rotate.

Ardcino

"</>" is the icon for inserting code not the tag itself. The tags are:

 [code]

// your code here

[/code]

Not many hobby servos will rotate 360 degrees. Earlier you said you were using continuous rotation (CR) servos but one can't control the position of CR servos, only their speed.

Dynamixel's AX-12A controllers allow one to position the output of a range of 300 degrees and can also be used to continuously rotate.
Thanks mate, and Yes I know I am a newb to this awesome hobby and I've all ready hacked my servos to spin 360. I just need to add a code to my main code to implement my radio's Receiver. I got the receiver from a 3d buddy of mine. I just don't know where to put it. And I am sorry if I confused anyone. 

DuaneDegn

I've all ready hacked my servos to spin 360.
This is my new code, and it works, How ever I am looking to make them rotate 360 not 180.
I'm not sure if you're aware once servos have been converted to continuous rotation, you can no longer command the servos to move to a specific location. The pulses one uses to tell the servo where to move will instead tell the servo how fast to move.

Ardcino

I'm not sure if you're aware once servos have been converted to continuous rotation, you can no longer command the servos to move to a specific location. The pulses one uses to tell the servo where to move will instead tell the servo how fast to move.
Yep I am aware of that that's why I purchased 12 of them and only hacking 4.


Go Up