Show Posts
Pages: 1 2 [3] 4 5 ... 98
31  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.
32  Using Arduino / Programming Questions / Re: Structure Arduino on: August 12, 2014, 01:28:44 pm
a typedef allows you to string some types together and call it a new name to make other code clearer. IOW, somewhere in your headers there is a
Code:
typedef  unsigned long size_t
33  Using Arduino / Programming Questions / Re: How to use indexOf by an byte array ? on: August 12, 2014, 10:02:05 am
How can you fit '0x4481' into a byte?
34  Using Arduino / General Electronics / Re: what's this phenomenon called? on: August 12, 2014, 09:57:54 am
I am old enough to have worked with vacuum tubes, but the battery I am describing is for a current system.
35  Using Arduino / Project Guidance / Re: 80x~ zoom on CMOS or TTL camera for Arduino? on: August 11, 2014, 04:53:57 pm
What does the Arduino provide? Video is not its strong suit.
36  Using Arduino / Project Guidance / Re: need to drive a zero centered meter on: August 11, 2014, 04:52:48 pm
Or, since meters are not very fast, a relay.
37  Using Arduino / Programming Questions / Re: Formatting tinygps output on: August 11, 2014, 01:39:59 pm
You are printing a float as an integer.
38  Using Arduino / Programming Questions / Re: The difference between while and if statements. on: August 11, 2014, 01:38:51 pm
Crossroads:
That is a *for* and a *while*, not an *if* and a *while*.

2007jingz:
Are you sure you are not confusing for and while, and not if and while?

In any case, the matter is academic, you use the construct that does what you want and expresses it clearly, so that it will be easily understood next year when you come back to it.
39  Using Arduino / Programming Questions / Re: The difference between while and if statements. on: August 11, 2014, 01:26:31 pm
A while statement is a loop: Keep doing this action until this thing happens.

An if statement is a decision: Do this action if this happens, or do this other action. Each action will only happen once.

They are not interchangeable.
40  Using Arduino / General Electronics / Re: what's this phenomenon called? on: August 11, 2014, 10:58:27 am
You can also call it a battery "tap", that is what we call it in the systems I work with. Our "battery" has taps at 25, 12, 6.8, 3.6 and -5 volts - and maybe some others I do not know about.
41  Using Arduino / Project Guidance / Re: Can i put a 9V battery on VIN pin? on: August 07, 2014, 06:28:08 pm
Here is a warning: A normal 9 V battery cannot supply the current to drive an UNO for very long.
42  Using Arduino / Programming Questions / Re: Challenge - Number conversion using binary manipulation on: August 07, 2014, 02:20:28 pm

Cool. So in machine code this is more efficient than using a subtraction, right?
Does the uC actually use 2's complement internally to do the subtraction? Any way I could have access to that as with other logical operators?


Addition and subtraction are just as efficient as any of the logical operators, multiply and divide are different stories.
43  Using Arduino / Programming Questions / Re: Challenge - Number conversion using binary manipulation on: August 07, 2014, 01:33:40 pm
And assuming that "binary manipulation" means logical operators, it is difficult to do arithmetic because you have to handle all the borrowing and carrying yourself.
44  Using Arduino / Programming Questions / Re: void... on: August 06, 2014, 04:43:59 pm
Probably not a good idea to have a PAINT() and paint() function, but in paint() you have a semicolon after the if statement.
45  Using Arduino / Programming Questions / Re: help fixing my code? :) on: August 06, 2014, 02:04:16 pm
Quote
z will probably a sound on a speaker

I assumed he meant the 'z' sound.

But you are right, he doesn't need all those variables.
Pages: 1 2 [3] 4 5 ... 98