Show Posts
Pages: 1 ... 3 4 [5] 6 7 ... 411
61  Using Arduino / Programming Questions / Re: Equation giving different results on: July 16, 2014, 01:31:31 pm
I think we've visited this pedantic rat-hole for long enough.
62  Using Arduino / Programming Questions / Re: #define, int or const int on: July 16, 2014, 01:25:25 pm
Saving RAM is important, but the key reason to use const, in my opinion, is to make sure you (the programmer) doesn't make a mistake.

This is SO much more complicated than Python...
With complexity comes power.  C/C++ are considered lower-level languages than scripting languages like Python.  Python offers simplicity, but at the cost of run-time resources.  On a PC (or SBC like a Pi), there are usually plenty to spare.  On an 8-bit microcontroller with 2,048 bytes of RAM, resources matter.
63  Products / Arduino Yún / Re: Issues with Yun + I2C on: July 16, 2014, 09:22:04 am
so i tested the MPU-6050 with a voltmeter and the i2c pins don't give anything out actually
I2C is an open collector bus.  If you don't measure using pull-up resistors, your voltmeter won't measure anything.
64  Using Arduino / Programming Questions / Re: Capturing data from the web on: July 16, 2014, 08:45:05 am
What kind of data?  What format is it in?  What do you want to do with the data?  Which Arduino are you using?
65  Using Arduino / Programming Questions / Re: #define, int or const int on: July 16, 2014, 08:40:02 am
#define ledPin = 13
This is a great example of why #define shouldn't be used. 

This is going to introduce confusing compiler messages and a difficult to locate bug...

Is it important to declare it as such? The other example works without. Or is it a matter of choice?
Personally, I avoid #define except for keywords to make reading my code easier.  For example, when using pull-up resistors on my buttons, I usually do this:

#define PUSHED LOW

const does two things for you: 
1) to will let the compiler complain if your program tries to modify a value.  Which is good for things that shouldn't change while your program runs, e.g. pin numbers.   and
2) the compiler will try place the variable in RAM if it can fit in a register.

As for #2, the compiler is pretty smart.  If it sees in your program a non-const variable is never modified, it may actually treat it as a constant, never putting it into RAM. 

I did a write up here, with a simple explain of how much RAM is used (checked with avr-size) when using const and when not:

There's also a link to in-depth analysis done of this forum:,86800.15.html
66  Using Arduino / Programming Questions / Re: Not writing to SD on: July 15, 2014, 07:23:48 pm
am using SPI to talk to the SD shield, the LCD shield AND the 3208 ADC.  It writes the header to the SD card, just not the data.
Except that the LCD "shield" probably isn't using SPI.  At least, the library you are using, isn't.
67  Using Arduino / Programming Questions / Re: Why compile error on Serial.printFloat ? on: July 15, 2014, 03:50:00 pm
This code line won't compile. Why printFloat is offered as an alternative by intellisense ?
Don't put so much faith into the keyword highlighting to call it "Intellisense".   It's not.

It is just simple keyword matching.  Every library has a list of keywords associated with it.  The IDE highlights those words if you use that particular library or not.

Serial.printFloat() isn't an Arduino function.  However, there's no need to call a funciton to print a float.  Serial.print(T_outmax); will work fine, assuming T_outmax is declared as a float.
68  Using Arduino / Programming Questions / Re: open source or something similar? on: July 15, 2014, 09:13:15 am
I'm sure you had a reason for this post, I'm just failing to see it.

Are you asking a question, showing off a product, or making a statement?
69  Using Arduino / Programming Questions / Re: Equation giving different results on: July 15, 2014, 09:11:00 am
I do not understand what is different between the two approaches, mathematically they are the same but through arduino it is different.
Not different in the Arduino, but different to the compiler.  When different variable types are mixed, the compiler sometimes make a bad guess on how to handle the overall calculation.  Keep in mind that numbers like "60" are constants and usually, the compiler will treat them as an integer (int).  So you're mixing ints, longs, and floats (double doesn't exist in AVR).

As already suggested:
1.  Keep the intermediate steps.  They'll likely get optimized out.  Personally this is my method because it allows me to visually see the variable types and their expected results when I scan through the code.

2.  Convert your integers into floats, so they get treated as floats (or as long).  The simplest way is adding the decimal.
70  Using Arduino / Installation & Troubleshooting / Re: Multiple arduino a on: July 15, 2014, 08:31:33 am
Are the "COM" id's static, meaning ... if I plug a board in to the top USB port will it always be COM7? 
It's been my experience that Windows will do one of two things, depending on the device.  Either it'll assign the same COM Port, as long as the device is plugged into the same USB port.  Or it'll assign the same COM Port regardless of where the device is attached.

Probably depends on the device itself.  And in this case device doesn't mean "Arduino board."  I'm referring to the actual USB to Serial chip/device, which varies by board.

There isn't a rule, so there is a definitive answer.

The best thing to do is, is try it and see what happens.

... are there ports that I need to stay away from?
The ports that aren't USB.

  Also this is a lap top.
Makes no difference

  How will USB docks affect the arduino setup? 
A USB hub or a laptop docking station?  Well, regardless, doesn't matter.
71  Using Arduino / Installation & Troubleshooting / Re: Cannot open Serial monitor on: July 14, 2014, 09:09:09 pm
1.5.x is beta.
72  Using Arduino / Installation & Troubleshooting / Re: Cannot open Serial monitor on: July 14, 2014, 08:08:12 pm
Next time, post that kind of thing with code tags [code][/code].

Have you tried adding a last.serial.location? 

Like last.serial.location=455,469,500,500
73  Using Arduino / Installation & Troubleshooting / Re: Uploaded Boards not showing in Arduino 1.5.7 BETA on: July 14, 2014, 06:36:37 pm
This removed 1.0.5 of course.
It did?  How? 

I find that all other boards I have installed (Pro Mini, Pro Micro and Attiny) have disappeared.
Did you update the 1.5.x's boards.txt file with the boards you've "installed"?
74  Using Arduino / Installation & Troubleshooting / Re: Why is my arduino not uploading? on: July 14, 2014, 06:33:07 pm
Are you changing the board type to match the bootloader of the chip/board you are using?
75  Using Arduino / Installation & Troubleshooting / Re: Multiple arduino a on: July 14, 2014, 06:32:11 pm
Each will be on a different "COM" port correct? 
Yes.  Your operating system (you didn't say which) will assign each board a new port name.
Pages: 1 ... 3 4 [5] 6 7 ... 411