Show Posts
|
|
Pages: 1 [2] 3 4
|
|
17
|
Using Arduino / Programming Questions / Re: Xbee Communication
|
on: February 08, 2013, 05:58:37 pm
|
So if i understand you, in the serial monitor i can send message to another xbee and he can understand that message, exemple if i send to serial monitor " analogWrite(3, HIGH); ", he will put +5v to the 3 pin
No. The Arduino receiving the message has to parse the character stream coming through the Xbee and then act appropriately. Sending an actual Arduino function call within a string will not automatically call that function. You are just sending bytes over the Xbees, that is it. You know a good way to learn this is to Google "xbee arduino tutorial". There are many to choose from to help you understand this. Another good place to look is chapter 14 of the book "Arduino Cookbook". Great explanations and good sample code.
|
|
|
|
|
20
|
Using Arduino / Programming Questions / Re: c++ library restrictions
|
on: February 08, 2013, 05:11:30 pm
|
Can any c++ library be brought into arduino? Or does something have to be done to do so?
It really depends on the library. If you read the link I posted on the STL port you will see he had to do a bit of work to get things to work. Something simple might be a straight port while others might be quite impossible with the limited memory one must work with. Oh and let me correct myself, normally libraries end with .h. I thought his port for the vector library had .h on the end but according to the sample code on his website I was mistaken.
|
|
|
|
|
21
|
Using Arduino / Programming Questions / Re: c++ library restrictions
|
on: February 08, 2013, 04:58:43 pm
|
Yup, that is definitely the problem.
This is kind of what I am trying to understand, what libraries are in arduino, and which ones are not.
Interesting, I will check out the post, thanks.
Here is the list of libraries that are installed with the Arduino ide: http://arduino.cc/en/Reference/LibrariesIf you decide to download a library and install it yourself, follow these instructions: http://arduino.cc/en/Guide/LibrariesAlso just FYI... when you include a file it normally has the .h extension. The code you posted just said #include <vector> but should have been #include <vector.h> had you indeed installed the library.
|
|
|
|
|
27
|
Topics / Robotics / Re: 12 Servo Quadruped - Servo Shield selection discussion
|
on: February 08, 2013, 09:36:00 am
|
The reason people use devices such as the SSC-32, is that it enables you to subdivide your code into manageable parts. Absolutely. Combining the servo controller logic with autonomous logic and sensor data processing into one program is difficult. Separating them improves both manageability and performance.
|
|
|
|
|
28
|
Using Arduino / Motors, Mechanics, and Power / Re: MD22 I2C motor driver + arduino uno
|
on: February 08, 2013, 09:25:24 am
|
I mean the other speed steps. How can i obtain any speed (not a full speed) without giving just 0 or 255 . Should i give a number between 0 and 255 to get that speed. One of the pages you posted has the answer to this http://www.robot-electronics.co.uk/htm/md22tech.htmIf you look at that page and scroll down to the section called Mode Register there seems to be different modes you can set. The default mode 0 says the following: (Default Setting) If a value of 0 is written to the mode register then the meaning of the speed registers is literal speeds in the range of: 0 (Full Reverse) 128 (Stop) 255 (Full Forward).So in this mode, I assume that 191, the number between 255 and 128, would give you half speed in one direction.
|
|
|
|
|
30
|
Using Arduino / Motors, Mechanics, and Power / Re: MD22 I2C motor driver + arduino uno
|
on: February 07, 2013, 05:29:03 pm
|
|
When an Arduino talks to an MD22 to drive a motor it doesn't send PWM and direction signals like most motor shields/controllers do.
The MD22 has a chip on it that is talking to the Arduino using I2C. I2C is a two wire communication protocol. In I2C, each device connected to the Arduino has an address which is what you need to communicate with it. In this case, the I2C address for the MD22 is defined as MD22ADDRESS(0x58).
When you write to the driver to control the motors you send two bytes, the motor and the speed. It appears that setting a speed of 128 stops the motors, 255 makes it go the maximum speed in one direction, and 0 makes it go the maximum speed in the other direction.
The two motors are defined as MOTOR1(0x01) and MOTOR2(0x02).
PWM does happen but it is happening between the motors and a chip on the MD22. The Arduino just sends this chip commands to send the appropriate PWM signals to the motors.
Not sure this answered what you wanted.
|
|
|
|
|