I have a 4 wheeled moblie robot and i need to program it with arduino UNO any one can helpm pls:
Structure:
4wheels + 4 motors MY101Z2 + 2 Dual motor controllers (sabertooth 25A) + 6 Ultrasonic range finders (maxbotix)
Thank you
I have a 4 wheeled moblie robot and i need to program it with arduino UNO any one can helpm pls:
Structure:
4wheels + 4 motors MY101Z2 + 2 Dual motor controllers (sabertooth 25A) + 6 Ultrasonic range finders (maxbotix)
Thank you
I have a 4 wheeled moblie robot and i need to program it
With those requirements, you should be done in no time.
ok thank you
can you give me a kick start then or guide me on how to start this,,
can you give me a kick start then or guide me on how to start this,,
Oh, sure. Here's a start
// Global variables go here
void setup()
{
// Do whatever you need to do here
}
void loop()
{
// stuff done all the time goes here
}
You'll get less smart-ass answers if you define what the robot is supposed to do. Sit there and look pretty can be done with the above sketch.
i didnt quite get what u meant there,
and yes i have familiarised my self with the code the u wrote..
basically i want the robot to avoid obstacles as something to start with so im not worried abt navigation now ,
so i wan it to read from data from sensors and fead it back to the motor controllers and the motors,,
thank you
basically i want the robot to avoid obstacles as something to start with so im not worried abt navigation now ,
That's simple, then. Don't move. Nothing will be in the way, then.
Your robot needs a purpose - even if that purpose is to wander around aimlessly. You haven't defined a purpose, so it is impossible to tell you what to do.
You should start, though, by learning to connect, and read, the sensors that you have. Then, learn to connect, and control, the motor shield and motors and batteries. When you have some idea how each piece works, you'll have a better idea what the robot can do, and how the software pieces fit together.
i have an idea on the distances my sensors can read as an experiment was done previously..
now i need to know how to interface the sensors with the arduino and the motor controllers... i need an idea how to connect them together and how to give the right instructions to the motors,
thnx
It looks like the Sabretooth controller can be configured to look like a standard servo, so look at the servo library. I would think that would be the easiest control option.
that helped thanx , but as the sabertooth has S1 and S2 pins shall i assume that S1 is for the first controller and S2 is for the second one....
Now the next thing is how can i write or implement a code to control to Sabertooth boards and to receive data from six ultrasonic sensos (maxbotix LV ez0)
Now the next thing is how can i write or implement a code to control to Sabertooth boards and to receive data from six ultrasonic sensos (maxbotix LV ez0)
Your first step is to write code to control one motor controller and receive data from one sonar.
After that, it's just a question of scaling-up.
keep going , how can i do that
hesham2012:
keep going , how can i do that
You do some research yourself. I gave you a link to the servo library earlier.
If u havent noticed, what they saying is- Sit down, write the code yourself, and if you have problems with parts of it, come back and ask for specific questions for help.
No one else will write the code for you, if thats what you expect. Or, open your pockets and buy a well supported platform, where most of the work is half done... Even then you will need a lot of work.
Or, as someone said before- dont move and then it wont need to avoid things !
Arduino is also Synonym of lots of hard work, lots of research and lots of frustrating times ...
UNLESS YOU ARE THE FIRST TO BUILD A ROBOT THAT BUILDS ROBOTS< SO PEOPLE LIKE YOU NEVER NEED TO , AGAIN !! lol
Dont get me wrong, here, just trying to get you in the right direction.
Hi from another beginner.
I sort of feel your frustration.
I would love to get into robotics but have other things more important just now to resolve.
PLEASE READ THIS REPLY!
Some idieas to help you get your head around what you need to do.
1 - as stated by others, you need to know what you want to robot to do.
2 - I am learning how to program myself and have NO IDEA how it works. NONE!
3 - Forget about writing the program just now and draw something like a flowchart of what you want it to do.
(now it gets complicated)
If it "just sits there and doesn't move" what happens if you put a block infront of it? Does it move backwards away from it?
And ofcourse does it have "reverse sensors"?
Try this:
It IS just sitting there. Not moving. It sees all around itself. Say 4 points, though you could make it 8 to be safer.
It's "safe" distance is (say) 10 cm.
Work out what signal/s are detected when something is closer than 10 cm.
Look for those inputs.
If detected, avoid.
"avoid" is a bit ambiguous, but you will have to work out if it turns, stops, goes backwards - exactly where it has been, or what ever.
Ofcourse there will be a "trap" right at the begnining if it is not in a clear space and detects something infront of it.
So, say it starts in a clean/clear place. All sensors detect clear.
It then starts to move STRAIGHT AHEAD.
Then the sensors start to scan and if something is detected in the FRONT area, it takes evasive action/turns/what ever.
You will have to work out how it deals with objects which start to encroach on it from the side. Say it is slowly approaching a wall. It isn't a full on detection, but the side sensors are starting to detect something.
Anyway, work this out in blocks and how they flow from one to the other.
Once you have an understanding of the flow of what is happening you may have a better chance of writing the program.
I hope that was helpful, and sorry for any spelling mistakes, the display is just a wee bit too far away from my eyes.
Try what's been suggested already:
Make a sensor work reliably -with- the Arduino.
i have an idea on the distances my sensors can read as an experiment was done previously..
now i need to know how to interface the sensors with the arduino
And Sarah Palin can see Russia from her back yard, but it doesn't make her a diplomat.
Sorry, I was just trying to explain it in another way to maybe help them understand the bigger picture.
That's just the pernt. He shouldn't be playing at the big picture until he knows how to make the small ones work.. separately.
I want to make a car. It should be big and have 4 of those round things called wheels near the corners and something to make it go, uhhh, some kind of motor. I've read about motors, pretty sure it needs a motor. I probably need some way to steer it but I haven't decided yet. Oh yeah, and some other junk, could somebody give me a list but keep it short?
Hello.
I think you should try to implement the controlling program as a state machine (google it),
it will allow you to split the various parts of motor control and sensor checking into smaller more understandable parts.
Put in the motor control first, and use the serial library to send commands to the state machine.
In this way you should be able to get started with the basic parts.
You should try to figure out most of the interfacing and programming of the shields yourself, it should be quite simple to get started.
thanx guys 4 your replies
im also struggling with the connections here:
i need to connect six sensors to the arduino so that i can receive analog readings in the same time and then i need to connect the motor controllers to the arduino board ,
can someone tell me how to do that or direct me to any page that can show me how
(i have 6 sensors== maxbotix lv-ez0,,,, and 2 motor controllers== sabertooth 25A dual)
n then it looks like imma have to find a way to establish the communication between both ends,
HOW can i modify the following code to make it read from six sensors:
[/*
* EZ1Rangefinder Distance Sensor
* prints distance and changes LED flash rate
* depending on distance from the Ping))) sensor
*/
const int sensorPin = 5;
const int ledPin = 13; // pin connected to LED
long value = 0;
int cm = 0;
int inches = 0;
void setup()
{
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
}
void loop()
{
value = pulseIn(sensorPin, HIGH) ;
cm = value / 58; // pulse width is 58 microseconds per cm
inches = value / 147; // which is 147 microseconds per inch
Serial.print(cm);
Serial.print(',');
Serial.println(inches);
digitalWrite(ledPin, HIGH);
delay(cm * 10 ); // each centimeter adds 10 milliseconds delay
digitalWrite(ledPin, LOW);
delay( cm * 10);
delay(20);
}]