Show Posts
Pages: [1] 2 3 ... 97
1  Using Arduino / Microcontrollers / Re: existentialist question: why arduino leonardo Takes that name? on: August 19, 2014, 12:03:51 pm
Are you a Carl Sagan fan?
http://en.wikipedia.org/wiki/Power_Macintosh_7100
2  Using Arduino / Programming Questions / Re: String.length() always return 0 on: August 19, 2014, 12:00:06 pm
Is your length() method in the global area? It might need to be in an actual code section.
3  Using Arduino / Programming Questions / Re: String.length() always return 0 on: August 19, 2014, 11:49:47 am
Constructive help:
Ditch String.

Use string.h and strlen().

More constructive help:
Provide a compilable, runnable example.
4  Using Arduino / General Electronics / Re: What is a calabrating battery type called? on: August 18, 2014, 03:32:37 pm
http://www.nist.gov/calibrations/voltage.cfm
5  Using Arduino / Programming Questions / Re: multiplication problems on: August 18, 2014, 11:53:08 am
Yes. as was already said:
Quote
You're probably using signed variables, which when the number gets big enough to make the left most bit a 1, actually goes -ve becasue the left most bit is the sign.
6  Using Arduino / Programming Questions / Re: multiplication problems on: August 18, 2014, 11:42:59 am
You're probably using signed variables, which when the number gets big enough to make the left most bit a 1, actually goes -ve becasue the left most bit is the sign.

Use unsigned and you'll be good....

Unsigned can overflow, too.
7  Using Arduino / Programming Questions / Re: multiplication problems on: August 18, 2014, 11:42:01 am
Show your code.

However, in this case I can psychically determine the issue: Your multiplication results are too big to fit into the type chosen, which might be intermediate types chosen by the compiler to perform constant pre-calculating.
8  Using Arduino / Programming Questions / Re: I cant insert code, please help..... on: August 18, 2014, 11:31:18 am
There is nothing "unstable" about braces '{}'.

Use them when you want to group several statements as one, or as part of a function definition.
9  Using Arduino / Programming Questions / Re: How do I understand all the libraries required to program a quad copter? on: August 18, 2014, 11:14:56 am
What is your background and current knowledge in physics and math, including tensors?
10  Using Arduino / Programming Questions / Re: About the "int" data type variable on: August 14, 2014, 02:10:47 pm
I didn't say *use* a bitfield, I said check it out. 8^)

And I am sure a compiler could work things to have an addressable single bit variable.

From the C programming FAQ:

"Some 64 bit Cray machines represent int * in the lower 48 bits of a word; char * additionally uses the upper 16 bits to indicate a byte address within a word."
11  Using Arduino / Programming Questions / Re: [FreeIMU library] errors within the library? on: August 14, 2014, 12:46:58 pm
It is only defined if all those others are defined.
12  Using Arduino / Programming Questions / Re: [FreeIMU library] errors within the library? on: August 14, 2014, 11:37:54 am
Ugh, that is pre-processor abuse.

Are you sure HAS_ITG3200() is defined? Though those parens look odd.
13  Using Arduino / Programming Questions / Re: [FreeIMU library] errors within the library? on: August 14, 2014, 11:11:29 am
Why is that #endif right below the function declaration?
14  Using Arduino / Programming Questions / Re: About the "int" data type variable on: August 14, 2014, 10:06:35 am
A bool *could* be one bit, but it would take too long to access it, so the compiler makes it a byte for speed reasons.

C does allow for single-bit variables: check out bitfields.
15  Using Arduino / Programming Questions / Re: Little Help Understanding What's Happening In Code Between Library & Sketch? on: August 12, 2014, 04:59:04 pm
unsigned means that the value can only take on positive numbers.

For example, a signed int ranges from about -32000 to 32000 while an unsigned int ranges from 0 to 64,000

unsigned ints can give you twice the range at the expense of being only positive. This is why they are used for millis(), for example, since millis() returns a counter that will never go below zero.

For a temperature, you would want a signed int since they can go below zero.
Pages: [1] 2 3 ... 97