Show Posts
Pages: [1] 2 3
1  Using Arduino / Project Guidance / Re: how to set up raido control on: October 27, 2013, 09:58:07 pm
well i have Ben thinking and i was wondering if trying to use the RC controller  as a type of  potentiometer wood be a way to go with programming my arduino to receive the signal from my receiver.  plus i am all out of ideas was hoping i could bounce this idea  around and see what all of u think about this idea. thanks in advance.   
2  Using Arduino / Project Guidance / Re: how to set up raido control on: October 16, 2013, 01:07:40 pm
 
Quote

so what readings are you getting when you send the receiver a command? If you push the joystick forward and reverse, do you see any change in readings? Could you perhaps post what you are getting?

hears what reading i got. i dont know how much u need for info on the readings.

Code:
thro  aile elev rudd gear
back 1093   0     0       0       0
           1098   0     0       0       0
 forward 1096   0     0       0       0
Quote
Ok, so if not with the joystick, how did you get "it" to move forward?

were the forward is i put   pinMode(A5=A0,HIGH) under that and it took off moving forward.
the A5 is the pin on the mega 2560 and the A0 is a pin on the motor shield.
now the controller i have is for an rc airplane  i don't think i had noted that.
if there is any thing i missed let me know and thanks for the help in advance.
3  Using Arduino / Project Guidance / Re: how to set up raido control on: October 15, 2013, 06:21:45 pm
what i am trying to do is make it move forward when i push the joy stick forward for starters. what i have gotten so far is forward movement but not with joystick forward. and i can get my serial monitor to work and show i am receiving signal from the rc receiver .  if i have left  any thing out pleas let me know and thank u in advance.           


this is what i have so far.

Code:
int pinI1=8;//define I1 interface
int pinI2=11;//define I2 interface
int speedpinA=9;//enable motor A
int pinI3=12;//define I3 interface
int pinI4=13;//define I4 interface
int speedpinB=10;//enable motor B
int spead =127;//define the spead of motor


void setup()
{
  pinMode(pinI1,OUTPUT);
  pinMode(pinI2,OUTPUT);
  pinMode(speedpinA,OUTPUT);
  pinMode(pinI3,OUTPUT);
  pinMode(pinI4,OUTPUT);
  pinMode(speedpinB,OUTPUT);
}

void forward()
{
     analogWrite(speedpinA,spead);//input a simulation value to set the speed
     analogWrite(speedpinB,spead);
     digitalWrite(pinI4,HIGH);//turn DC Motor B move clockwise
     digitalWrite(pinI3,LOW);
     digitalWrite(pinI2,LOW);//turn DC Motor A move anticlockwise
     digitalWrite(pinI1,HIGH);
}

foward();


this is were i got my example code. on how to use my motor shield.

//. Motor driver shield- 2012 Copyright (c) Seeed Technology Inc.
//
//  Original Author: Jimbo.we
//  Contribution: LG
// 
//  This library is free software; you can redistribute it and/or
//  modify it under the terms of the GNU Lesser General Public
//  License as published by the Free Software Foundation; either
//  version 2.1 of the License, or (at your option) any later version.
//
//  This library is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//  Lesser General Public License for more details.
//
//  You should have received a copy of the GNU Lesser General Public
//  License along with this library; if not, write to the Free Software
//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

Code:
int pinI1=8;//define I1 interface
int pinI2=11;//define I2 interface
int speedpinA=9;//enable motor A
int pinI3=12;//define I3 interface
int pinI4=13;//define I4 interface
int speedpinB=10;//enable motor B
int spead =127;//define the spead of motor
 
void setup()
{
  pinMode(pinI1,OUTPUT);
  pinMode(pinI2,OUTPUT);
  pinMode(speedpinA,OUTPUT);
  pinMode(pinI3,OUTPUT);
  pinMode(pinI4,OUTPUT);
  pinMode(speedpinB,OUTPUT);
}
 
void forward()
{
     analogWrite(speedpinA,spead);//input a simulation value to set the speed
     analogWrite(speedpinB,spead);
     digitalWrite(pinI4,HIGH);//turn DC Motor B move clockwise
     digitalWrite(pinI3,LOW);
     digitalWrite(pinI2,LOW);//turn DC Motor A move anticlockwise
     digitalWrite(pinI1,HIGH);
}
void backward()//
{
     analogWrite(speedpinA,spead);//input a simulation value to set the speed
     analogWrite(speedpinB,spead);
     digitalWrite(pinI4,LOW);//turn DC Motor B move anticlockwise
     digitalWrite(pinI3,HIGH);
     digitalWrite(pinI2,HIGH);//turn DC Motor A move clockwise
     digitalWrite(pinI1,LOW);
}
void left()//
{
     analogWrite(speedpinA,spead);//input a simulation value to set the speed
     analogWrite(speedpinB,spead);
     digitalWrite(pinI4,HIGH);//turn DC Motor B move clockwise
     digitalWrite(pinI3,LOW);
     digitalWrite(pinI2,HIGH);//turn DC Motor A move clockwise
     digitalWrite(pinI1,LOW);
}
void right()//
{
     analogWrite(speedpinA,spead);//input a simulation value to set the speed
     analogWrite(speedpinB,spead);
     digitalWrite(pinI4,LOW);//turn DC Motor B move anticlockwise
     digitalWrite(pinI3,HIGH);
     digitalWrite(pinI2,LOW);//turn DC Motor A move clockwise
     digitalWrite(pinI1,HIGH);
}
void stop()//
{
     digitalWrite(speedpinA,LOW);// Unenble the pin, to stop the motor. this should be done to avid damaging the motor.
     digitalWrite(speedpinB,LOW);
     delay(1000);
 
}

void loop()
{
  left();
  delay(2000);
  stop();
  right();
  delay(2000);
  stop();
 // delay(2000);
  forward();
  delay(2000);
  stop();
  backward();
  delay(2000);
  stop();





and hear is an example i found on how to setup my rc receiver with arduino

Code:
int rx1 = 0;  //throttle control
int rx2 = 0;  //aileron control
int rx3 = 0;  //elevation control
int rx4 = 0;  //rudder control
int rx5 = 0;  //AUX switch
int rx6 = 0;  //Trainer momentary switch
#include <Arduino.h>
unsigned long time1 = 0;
unsigned long time2 = 0;
void setup() {
                   // initialize
  Serial.begin(115200);      // open the serial port at 115200 bps:
}
void loop() {
  rx1=pulseIn(A0,HIGH);
  rx2=pulseIn(A1,HIGH);
  rx3=pulseIn(A2,HIGH);
  rx4=pulseIn(A3,HIGH);
  rx5=pulseIn(2,HIGH);
  rx6=pulseIn(3,HIGH);
  Serial.print(rx1);
  Serial.print("\t");
  Serial.print(rx2);
  Serial.print("\t");
  Serial.print(rx3);
  Serial.print("\t");
  Serial.print(rx4);
  Serial.print("\t");
  Serial.print(rx5);
  Serial.print("\t");
  Serial.print(rx6);
  Serial.print("\t");
  Serial.println("\t");

4  Using Arduino / Project Guidance / Re: how to set up raido control on: October 15, 2013, 12:54:01 pm
hi i need a little help i am having a problem under standing how to get my rc receiver to communicate with my arduino i can read it wen i set it up with serial monitor. were i am having problems is writing the sketch to get my motors to go froward.
thanks for  help  in advance.   
5  Using Arduino / Project Guidance / Re: how to set up raido control on: September 30, 2013, 12:44:46 pm
thanks for thew help
6  Using Arduino / Project Guidance / Re: how to set up raido control on: September 29, 2013, 05:22:42 pm
i never put much thinking into witch pins to use. i do have pins 14,15,16,17,18,19. pins open on the other side.
if i may ask witch wood be a better choice to use?
thanks
7  Using Arduino / Project Guidance / Re: how to set up raido control on: September 29, 2013, 01:04:02 pm
i am using pins 8,A9,A10,A11,A12,A13 for my receiver. i never did think about using pulseIn().
thanks i will give it another go and see what i can do. 
8  Using Arduino / Project Guidance / Re: how to set up raido control on: September 28, 2013, 10:39:31 pm
hears what i have to work with the first script is for the seed studio motor shield. the other is a script i found on the internet that shows how to set up with the receiver spektrum ar600. thanks in advance 

//. Motor driver shield- 2012 Copyright (c) Seeed Technology Inc.
//
//  Original Author: Jimbo.we
//  Contribution: LG
// 
//  This library is free software; you can redistribute it and/or
//  modify it under the terms of the GNU Lesser General Public
//  License as published by the Free Software Foundation; either
//  version 2.1 of the License, or (at your option) any later version.
//
//  This library is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//  Lesser General Public License for more details.
//
//  You should have received a copy of the GNU Lesser General Public
//  License along with this library; if not, write to the Free Software
//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

int pinI1=8;//define I1 interface
int pinI2=11;//define I2 interface
int speedpinA=9;//enable motor A
int pinI3=12;//define I3 interface
int pinI4=13;//define I4 interface
int speedpinB=10;//enable motor B
int spead =127;//define the spead of motor
 
void setup()
{
  pinMode(pinI1,OUTPUT);
  pinMode(pinI2,OUTPUT);
  pinMode(speedpinA,OUTPUT);
  pinMode(pinI3,OUTPUT);
  pinMode(pinI4,OUTPUT);
  pinMode(speedpinB,OUTPUT);
}
 
void forward()
{
     analogWrite(speedpinA,spead);//input a simulation value to set the speed
     analogWrite(speedpinB,spead);
     digitalWrite(pinI4,HIGH);//turn DC Motor B move clockwise
     digitalWrite(pinI3,LOW);
     digitalWrite(pinI2,LOW);//turn DC Motor A move anticlockwise
     digitalWrite(pinI1,HIGH);
}
void backward()//
{
     analogWrite(speedpinA,spead);//input a simulation value to set the speed
     analogWrite(speedpinB,spead);
     digitalWrite(pinI4,LOW);//turn DC Motor B move anticlockwise
     digitalWrite(pinI3,HIGH);
     digitalWrite(pinI2,HIGH);//turn DC Motor A move clockwise
     digitalWrite(pinI1,LOW);
}
void left()//
{
     analogWrite(speedpinA,spead);//input a simulation value to set the speed
     analogWrite(speedpinB,spead);
     digitalWrite(pinI4,HIGH);//turn DC Motor B move clockwise
     digitalWrite(pinI3,LOW);
     digitalWrite(pinI2,HIGH);//turn DC Motor A move clockwise
     digitalWrite(pinI1,LOW);
}
void right()//
{
     analogWrite(speedpinA,spead);//input a simulation value to set the speed
     analogWrite(speedpinB,spead);
     digitalWrite(pinI4,LOW);//turn DC Motor B move anticlockwise
     digitalWrite(pinI3,HIGH);
     digitalWrite(pinI2,LOW);//turn DC Motor A move clockwise
     digitalWrite(pinI1,HIGH);
}
void stop()//
{
     digitalWrite(speedpinA,LOW);// Unenble the pin, to stop the motor. this should be done to avid damaging the motor.
     digitalWrite(speedpinB,LOW);
     delay(1000);
 
}

void loop()
{
  left();
  delay(2000);
  stop();
  right();
  delay(2000);
  stop();
 // delay(2000);
  forward();
  delay(2000);
  stop();
  backward();
  delay(2000);
  stop();
}


hear is the other script.

int rx1 = 0;  //throttle control
int rx2 = 0;  //aileron control
int rx3 = 0;  //elevation control
int rx4 = 0;  //rudder control
int rx5 = 0;  //AUX switch
int rx6 = 0;  //Trainer momentary switch
#include <Arduino.h>
unsigned long time1 = 0;
unsigned long time2 = 0;
void setup() {
                   // initialize
  Serial.begin(115200);      // open the serial port at 115200 bps:
}
void loop() {
  rx1=pulseIn(A0,HIGH);
  rx2=pulseIn(A1,HIGH);
  rx3=pulseIn(A2,HIGH);
  rx4=pulseIn(A3,HIGH);
  rx5=pulseIn(2,HIGH);
  rx6=pulseIn(3,HIGH);
  Serial.print(rx1);
  Serial.print("\t");
  Serial.print(rx2);
  Serial.print("\t");
  Serial.print(rx3);
  Serial.print("\t");
  Serial.print(rx4);
  Serial.print("\t");
  Serial.print(rx5);
  Serial.print("\t");
  Serial.print(rx6);
  Serial.print("\t");
  Serial.println("\t");
}
9  Using Arduino / Project Guidance / how to set up raido control on: September 28, 2013, 07:24:19 pm
hi i am using an mega 2560, seeed studio motor shield, and a radio controller spektrum dx5e with receiver  spektrum ar600
i am trying to build a robot that a can run around the yard but i cant grasp the concept of getting the arduino motor shield
and radio  receiver to work together. I have been working with arduino for about 4 months now and am new to this.

thanks for the help in advance. 
 
10  Topics / Robotics / Re: motor shield help on: October 15, 2012, 12:38:59 pm
this is what i have done for my script right now. just wondering if i am heading in the right direction.

thanks for the help in advance.

void setup() {
  // put your setup code here, to run once:
 pinMode(8,9,10,11);
 pinMode(4,5,6,7);
 
  speed = 30rpm;


}


11  Topics / Robotics / Re: first robot on: October 09, 2012, 08:15:10 pm
thanks for the advice.

well i know the stepper wont work\,this is stepping above what i have done with  arduino. arrays is all i have worked with.  what my plans are is to make a land rover of sorts that gos back forwards turns in a dime maybe even carry sensors cameras ext. 

thanks in advance
12  Topics / Robotics / first robot on: October 08, 2012, 07:27:36 pm
were do i start in building my first robot. what do i need to know?
thanks in advance 
13  Topics / Robotics / Re: motor shield help on: October 07, 2012, 08:21:18 am
thanks for the help i know what i half to do now.
14  Topics / Robotics / Re: motor shield help on: October 06, 2012, 04:08:54 pm
this is what i am working with i got both motors to work. but i need them to work at the same time. how wood i do this?
thanks in advance
/*
 Stepper Motor Control - one step at a time
 
 This program drives a unipolar or bipolar stepper motor.
 The motor is attached to digital pins 8 - 11 of the Arduino.
 
 The motor will step one step at a time, very slowly.  You can use this to
 test that you've got the four wires of your stepper wired to the correct
 pins. If wired correctly, all steps should be in the same direction.
 
 Use this also to count the number of steps per revolution of your motor,
 if you don't know it.  Then plug that number into the oneRevolution
 example to see if you got it right.
 
 Created 30 Nov. 2009
 by Tom Igoe
 
 */

#include <Stepper.h>
#include <Stepper.a>

const int stepsPerRevolution = 200;  // change this to fit the number of steps per revolution


// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8,9,10,11);
Stepper mySteppera(stepsPerRevolution,  4,5,6,7);

int stepCount = 0;         // number of steps the motor has taken

void setup() {
  // initialize the serial port:
  Serial.begin(9600);
}

void loop() {
  // step one step:
  myStepper.step(10);
  Serial.print("steps:" );
  Serial.println(stepCount);
  stepCount++;
  delay(500);
}
15  Topics / Robotics / motor shield help on: October 05, 2012, 07:23:56 pm
i am trying to hook two motors to a seeed studio motor shield i am using this stepper example to start me out.
but the pins are set up for one motor i wood like to add two motors to it i am using arduino 2560 mega
the pins i am using 8,9,10,11. how do i find the pins i need.

thanks in advance.


Pages: [1] 2 3