Arduino Forum

Topics => Robotics => Topic started by: Ardcino on Oct 28, 2015, 02:30 am

Title: Ardunio and a Transmitter?
Post by: Ardcino on Oct 28, 2015, 02:30 am
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? 

Title: Re: Ardunio and a Transmitter?
Post by: PaulS on Oct 28, 2015, 11:13 am
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?

Title: Re: Ardunio and a Transmitter?
Post by: zoomkat on Oct 28, 2015, 06:43 pm
The below might have info.

https://www.google.com/search?ie=UTF-8&oe=UTF-8&q=rc+transmitter&btnG=search&domains=http%3A%2F%2Fforum.arduino.cc&sitesearch=http%3A%2F%2Fforum.arduino.cc&gws_rd=ssl (https://www.google.com/search?ie=UTF-8&oe=UTF-8&q=rc+transmitter&btnG=search&domains=http%3A%2F%2Fforum.arduino.cc&sitesearch=http%3A%2F%2Fforum.arduino.cc&gws_rd=ssl)
Title: Re: Ardunio and a Transmitter?
Post by: Ardcino on Oct 30, 2015, 06:09 am
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
  }
}
Title: Re: Ardunio and a Transmitter?
Post by: zoomkat on Oct 30, 2015, 05:19 pm
#7 below:

http://forum.arduino.cc/index.php/topic,148850.0.html (http://forum.arduino.cc/index.php/topic,148850.0.html)
Title: Re: Ardunio and a Transmitter?
Post by: PaulS on Oct 31, 2015, 07:51 pm
Quote
#7 below:
Yep. Using that smiley face pin to drive a servo is just not going to work.
Title: Re: Ardunio and a Transmitter?
Post by: Ardcino on Nov 01, 2015, 08:51 pm
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
  }
}
</>
Title: Re: Ardunio and a Transmitter?
Post by: DuaneDegn on Nov 01, 2015, 09:42 pm
"</>" 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.
Title: Re: Ardunio and a Transmitter?
Post by: Ardcino on Nov 02, 2015, 09:40 pm
"</>" 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. 
Title: Re: Ardunio and a Transmitter?
Post by: DuaneDegn on Nov 02, 2015, 10:04 pm
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.
Title: Re: Ardunio and a Transmitter?
Post by: Ardcino on Nov 03, 2015, 09:05 pm
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.