Show Posts
Pages: [1] 2 3 ... 93
1  Using Arduino / Programming Questions / Re: const int / int on: July 23, 2014, 01:12:50 pm
Take it up with K&R, then.
Code:
"This is a string constant"

has a type of array of characters, and in fact you can even do something like this:
Code:
"abcdef"[5]

to refer to the 'f'.

or
Code:
5["abcdef"]

If you want to obfuscate.

http://c-faq.com/aryptr/joke.html
2  Using Arduino / Programming Questions / Re: Help needed, How do you set Arduino internal clock with GPS NMEA on: July 23, 2014, 01:04:44 pm
The arduino has no system clock, so the SD  library just writes some default file create time, probably zero. You will have to change your SD library to change that.
3  Using Arduino / Programming Questions / Re: Help needed, How do you set Arduino internal clock with GPS NMEA on: July 23, 2014, 10:21:05 am
Just log the GPS time to the SD card. No need to "sync" the non-existent Arduino internal clock.
4  Using Arduino / Programming Questions / Re: const int / int on: July 23, 2014, 09:27:07 am
I disagree, econjack. A string constant has a type of "array of characters" and so decays to a pointer to its first element when used as in AWOL's example.
5  Using Arduino / Programming Questions / Re: const int / int on: July 23, 2014, 08:52:36 am
Hah! Thanks for the analogy.

But using a pointer with a const int is probably pretty rare, and actually points out another difference between a const and #define.
6  Using Arduino / Programming Questions / Re: const int / int on: July 23, 2014, 08:33:55 am
FlyingAngel:
You are wrong.

const ints don't use RAM.
7  Using Arduino / Project Guidance / Re: How to change volume of sound on: July 22, 2014, 03:00:16 pm
You are missing a piece, Crossroads. The digital pot should be hooked up to this:
https://www.sparkfun.com/products/11044
8  Using Arduino / Programming Questions / Re: Problem with the Serial.read() command on: July 22, 2014, 09:20:53 am
Is your LED really on pin 12? Usually they are on pin 13.
9  Using Arduino / Programming Questions / Re: Clock Program Stopped on: July 21, 2014, 06:02:21 pm
....And where any memory leaks might be.
10  Using Arduino / Programming Questions / Re: EEPROM ovf error when reading GPS data on: July 21, 2014, 06:01:08 pm
Assuming that the address in the EEPROM is by byte, you need to add 4 to address each time. When you use real pointers, C and C++ automagically increments by the size of the object.

Personally, I would write only bytes and use a union to break the float apart, but that is just me.
11  Using Arduino / Programming Questions / Re: EEPROM ovf error when reading GPS data on: July 21, 2014, 05:35:08 pm
The problem might be with address. If it is a straight char pointer, it might be incrementing by 1 byte instead of the desired 4 bytes.
12  Using Arduino / Project Guidance / Re: Digital Pin Commands on: July 21, 2014, 04:07:31 pm
The BlinkWithoutDelay example will do this.
13  Using Arduino / Programming Questions / Re: Unexpected pow() behaviour on: July 21, 2014, 01:54:49 pm
Also good for converting watts to dBm's and other logarithmic functions.
14  Using Arduino / Programming Questions / Re: First steps debugging on: July 21, 2014, 01:51:50 pm
Debugging on the Arduino is done old school. Judiciously inserted print statements.
15  Using Arduino / Project Guidance / Re: frog detector on: July 17, 2014, 01:05:53 pm
Hook up a garage door opener to run a sweeper across the driveway to sweep the frogs out of the way.
Pages: [1] 2 3 ... 93