Show Posts
Pages: 1 [2] 3 4
16  Using Arduino / Programming Questions / Re: What is the Best and Free C++ Compiler for Windows(Among other Questions) on: February 08, 2013, 06:53:16 pm

Otherwise,  I would suggest Visual Studio,  for which there is a free version,  or at least there
was about a year ago when I installed it.

It's still free but after 30 days you have to register for a license ID.  It is not bad and the VS2012 has part of C++11 implemented.
17  Using Arduino / Programming Questions / Re: SumoBot help on: February 08, 2013, 06:15:53 pm
I have no clue because you did not post code.   However if you want to get the Ping sensor to work there is an example code that comes along with the IDE for that.

In the Arduino IDE menu click File -> Examples -> 06.Sensors -> Ping.

This code assumes your Ping sensor is hooked up to digital pin 7.  If it isn't then scroll to the line that says:  const int pingPin = 7;

Change the 7 to be the digital pin you connect the Ping sensor to.

As for the code for the Arduino Motor controller look at this tutorial:  http://www.instructables.com/id/Arduino-Motor-Shield-Tutorial/?ALLSTEPS
18  Using Arduino / Project Guidance / Re: Inspiration needed for burglar alarm. on: February 08, 2013, 06:06:21 pm
For an additional output use a GSM shield and send out SMS text  http://labs.arduino.cc/GPRS/Index

For additional inputs did you try looking into some of these   http://en.wikipedia.org/wiki/Burglar_alarm#Sensor_types
19  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: What is the Best and Free C++ Compiler for Windows(Among other Questions) on: February 08, 2013, 05:30:03 pm
It doesn't come with a compiler... you need a third-party compiler... hence my question...

Yes... but read the release notes:

    NetBeans C/C++ pack has been tested with the following compilers and tools (Windows):
        Cygwin 1.5.21
        Cygwin gcc-core (C compiler) 3.4.x
        Cygwin gcc-c++ (C++ compiler) 3.4.x
        Cygwin gdb (GNU Debugger) 6.5.50
        Cygwin make 3.80

http://netbeans.org/community/releases/60/cpp-setup-instructions.html

21  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
22  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.

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

24  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/
25  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/
26  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.
27  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
28  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
29  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. 
30  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.


Pages: 1 [2] 3 4