Pages: [1]   Go Down
Author Topic: Super New to Arduino  (Read 576 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 51
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So try number two stupid Safari quit on me while i was typing.

So anyway, I have been wanting to build some sort of robot for a long time, and i figured why not now lol. What i wanted to try and do was to build a robot that would drive on tank treds (which i already have) using 2 dc motors, then when it approaches some sort of obstacle it will stop, look both ways, and decide which was is best and then go that way.

I decided what parts i want to use, first of the Arduino micro processor. I recently purchased a book called 'getting started with the arduino' it really helped a lot and i feel like i have a better idea on how to program. Except i can't figure out how to connect and use the libraries i have found to control my motor driver, and my servo driver.

the servo driver i am going to get is:
Pololu Qik 2s9v1 Dual Serial Motor Controller

and the motor driver is:
Pololu Micro Serial Servo Controller

So i guess to make this super long post come to an end, i was hoping that someone could help not only explain to me how a Arduino library works. And more or less if anyone has any hints on how to use properly what i want to do.

Thanks for all the help!

ps. I know i don't need the servo controller but i figured i would want to use one eventually so i might as well learn that whilst learning the motor driver.
Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 5550
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
the servo driver i am going to get is:
Pololu Qik 2s9v1 Dual Serial Motor Controller

and the motor driver is:
Pololu Micro Serial Servo Controller

I think you meant to flip-flop those... smiley-wink

Quote
So i guess to make this super long post come to an end

Long? That ain't long! You should see some of the book length posts I write; I tend to wonder if some people think I am writing a thesis one post at a time...

 ;D


Quote
i was hoping that someone could help not only explain to me how a Arduino library works.

Well, you basically include it, instantiate an object from the class, then use that object to call methods and receive values...

Quote
And more or less if anyone has any hints on how to use properly what i want to do.

Well, for both of these Pololu products, you are going to want to use a software serial library (NewSoftSerial or something similar - I can't remember which is the "latest and greatest" for serial comms - probably the one by AdaFruit). Both devices can sit on the same serial pins if you wire everything up properly (you'll either need to use some diodes for isolation, or the boards may have a serial pass-thru so you can daisy chain them), and you use the software serial library to communicate with them using the protocol defined for them (in the docs for the boards).

I know there is code out there for the Micro Serial Servo Controller, but for the Dual Serial Motor Controller, I don't know - but I imagine you can find something there as well; if not, then the code is probably similar to that for the MSSC, since both are controlled via a serial protocol.

Converting the code you find into a library is possible, but if you are having these questions, it is probably outside your experience level. I've written an unpublished library for the MSSC (unpublished because it isn't tested yet - but it should work) - so if you get to that point, look me up again (maybe by then I'll have it tested and published?)...

But, basically, you will want to use the software serial library to communicate with the boards, sending them the commands to turn the motors on and control the direction and speed. Because the boards consist of essentially embedded microcontrollers (PICs, I think), once you send them a command, you are free to continue processing; this means you could command the motors to move, then use the serial servo controller to pan/scan a distance sensor (ultrasonic or IR) and process that data for changes, then when it does, send a new command to the motors. So, rather than the system stopping and starting as it is looking around, it can all be done "on-the-fly"...

 smiley
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Pages: [1]   Go Up
Jump to: