Show Posts
Pages: 1 2 [3] 4 5
31  Using Arduino / General Electronics / Re: How Are Masters and Slaves designated in I2C and SPI connections? on: February 08, 2013, 05:24:10 pm
Yep!  I find many tutorials to be great at explaining how to accomplish a simple task, but not so great at explaining how it's actually done under the hood. 

In the case of I2C, a cheap logic analyzer goes a long way as well   smiley
32  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.

33  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/Libraries

If you decide to download a library and install it yourself, follow these instructions:   http://arduino.cc/en/Guide/Libraries

Also 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.

34  Using Arduino / Programming Questions / Re: c++ library restrictions on: February 08, 2013, 04:44:20 pm
For example, in a sketch, I tried to make a vector, a dynamic array, but the sketch would not allow me to do this.

NJavrGuy,  Are you trying to use vectors from the standard template library?  Just fyi they are not there.

However someone did go through the trouble of porting them  http://andybrown.me.uk/wk/2011/01/15/the-standard-template-library-stl-for-avr-with-c-streams/
35  Using Arduino / Programming Questions / Re: What is the Best and Free C++ Compiler for Windows(Among other Questions) on: February 08, 2013, 04:12:44 pm
Anyway, then what compiler fits netbeans? That is the IDE I am used to.

You are aware that there is a Netbeans C++ bundle available for download.   http://netbeans.org/features/cpp/
36  Using Arduino / General Electronics / Re: How Are Masters and Slaves designated in I2C and SPI connections? on: February 08, 2013, 03:43:32 pm
Okay, so the Wire.begin(); sets the clock speed. But both Arduinos have a command in their code called Wire.begin(). So whos becomes the master?

If you read the Wire.begin() reference you would see the following:
   Parameters
      address: the 7-bit slave address (optional); if not specified, join the bus as a master.

http://arduino.cc/en/Reference/WireBegin

Go look at the link I provided in an earlier post in this thread.   It shows both the master and slave code examples.
37  Using Arduino / General Electronics / Re: How Are Masters and Slaves designated in I2C and SPI connections? on: February 08, 2013, 02:29:05 pm
But I also read the code example in the link provided, and I don't see where the master Arduino set the speed. If in the line:

It is setting it by default to 100Mhz.   See this post for how to change that  http://arduino.cc/forum/index.php/topic,16793.0.html
38  Using Arduino / General Electronics / Re: How Are Masters and Slaves designated in I2C and SPI connections? on: February 08, 2013, 10:27:40 am
Why not just look at the tutorial on the Arduino website?   http://arduino.cc/en/Tutorial/MasterReader
39  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. 
40  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.htm
If 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.


41  Using Arduino / Programming Questions / Re: simple message lib not found on: February 07, 2013, 06:09:11 pm
Isn't SimpleMessageSystem really old and was replaced by http://playground.arduino.cc//Code/CmdMessenger

Just askin.
42  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.
43  Using Arduino / Motors, Mechanics, and Power / Re: Motor Shield Capable of Driving 5 DC motors? on: February 07, 2013, 05:10:46 pm
I've not seen any shields that can handle 6A per channel but I have found boards that are relatively easy to wire up over at Pololu.
44  Using Arduino / Networking, Protocols, and Devices / Re: Connecting to more than 1 url. on: February 07, 2013, 04:45:20 pm

When you are done with the connection you should call client.stop() and client2.stop();
45  Using Arduino / Programming Questions / Re: ints and long calculation on: February 07, 2013, 03:31:47 pm
I originally posted this back in October

http://arduino.cc/forum/index.php/topic,125534.msg943800.html#msg943800
Pages: 1 2 [3] 4 5