Show Posts
Pages: 1 [2] 3 4 ... 265
16  Using Arduino / Programming Questions / Re: wich sleep mode will keep a date/time running? on: April 07, 2014, 10:38:59 am
If you want to work in scales of more than milliseconds then you really require an RTC chip.  If you want to keep track of the time and date while the Arduino is either busy doing something else, sleeping, or even turned off, then you require an RTC chip.

The most common is the DS1307, and there are millions of shields with them on around the place.
17  Using Arduino / Programming Questions / Re: wich sleep mode will keep a date/time running? on: April 07, 2014, 10:24:16 am
Sounds like you need an RTC chip...?
18  Development / Other Software Development / Re: UECIDE: A New Fork of the IDE on: April 07, 2014, 09:18:47 am
Things have been leaping on ahead with UECIDE recently.  There have been many big changes.

Today's big change is to allow multiple locations for user libraries.  You can now specify many places for the IDE to look for libraries, and each location has its own menu entry and everything.

Read more here: http://www.uecide.org/forum/viewtopic.php?f=9&t=167
19  Using Arduino / General Electronics / Re: FPGA development board on: April 07, 2014, 08:19:30 am
I use the DE0 Nano from Altera.  It's a good low-cost introduction to FPGAs.  It doesn't have all the bells and whistles, with just an accelerometer, ADC, SDRAM and things, but for the price it's a great way to learn about them.
20  Using Arduino / Programming Questions / Re: Debugging help on: April 06, 2014, 07:25:29 pm
How about a schematic?  And you know you can attach your code as a file, don't you?  If you're unable to use code tags like you should then attach the file.
21  Using Arduino / Programming Questions / Re: Writing header to data logger file in a SD card shield ?? on: April 06, 2014, 06:05:52 pm
By default, when you open a file for writing, it will truncate the file and you start from the beginning.

Try changing
Code:
  File logfile = SD.open("logger.csv", FILE_WRITE);
to
Code:
  File logfile = SD.open("logger.csv", FILE_WRITE | O_APPEND);

and see if that helps.
22  Using Arduino / Motors, Mechanics, and Power / Re: Power supply on: April 06, 2014, 04:03:38 pm
With amps, it's never "too much" - you have to ask "is it enough?"

The current rating of a power supply is the upper limit of what it can provide without it melting.
23  Using Arduino / Programming Questions / Re: Struct as argument on: April 06, 2014, 03:22:54 pm
As I think I have already said - it scans through and finds all functions, makes prototypes, and add then just after the last #include (and before everything else).

Actually, to be more precise, it finds the first line in the file that doesn't start with a # (after stripping the comments) and places the prototypes before that line.

I think that's the wrong approach, really.  It should identify the line on which the first function is defined (which it should be able to find while scanning through the file) and place all prototypes directly before that line - that way it will catch all structs, typedefs, etc that are defined at the top of the sketch.  Won't help with any defined part-way through of course...
24  Using Arduino / Motors, Mechanics, and Power / Re: Power supply on: April 06, 2014, 03:02:00 pm
In that case, yes, you can plug that direct into the USB socket of the Arduino, or connect it direct to the +5V pin on the power header.

You can't connect it to the barrel jack though.
25  Using Arduino / Programming Questions / Re: Struct as argument on: April 06, 2014, 02:15:48 pm
The "key" struct is before the
Code:
void assignToBoard(key &obj1, analogMultiplexer &obj2) {
which YOU put in, but it is AFTER the
Code:
void assignToBoard(key &obj1, analogMultiplexer &obj2);
that the IDE puts in.

When you compile your code the IDE generates a .cpp file in your "build" folder.  Examine that folder and you'll see the .cpp file.  Look at that .cpp file and all will become clear.
26  Using Arduino / Programming Questions / Re: Struct as argument on: April 06, 2014, 01:35:11 pm
Because of where the IDE puts the prototypes.

If you have type "foo" in a header file "foo.h" and type "bar" defined in your sketch, and do something like:
Code:
#include "foo.h"

typedef struct {
  int a;
  int b;
} bar;

void setup() {
}

void loop() {
}

void foobar(foo &f, bar &b) {
}
what you actually end up with, after the inclusion of the header file and the munging by the IDE is:

Code:
typedef struct {
  int x;
  int y;
} foo;

void setup();
void loop();
void foobar(foo &f, bar &b);

typedef struct {
  int a;
  int b;
} bar;

void setup() {
}

void loop() {
}

void foobar(foo &f, bar &b) {
}
See how the prototype for foobar is before the definition of bar, but after the inclusion of foo, so it fails because of the bar, but the foo is ok.
27  Using Arduino / Programming Questions / Re: Arduino IDE tabs on: April 06, 2014, 12:56:39 pm
I think you mean #include, not #import.

Header files (.h files) need to be included into source files for them to have any meaning.

Source files (.ino) all get joined together into one humungous file before compilation, so you don't need to worry about exporting your functions from one file to another.
28  Using Arduino / Programming Questions / Re: Struct as argument on: April 06, 2014, 11:53:46 am
Quote
A string of towels defined in LPC?
Funny. It's really a long pointer to constant string (NULL terminated array of TCHAR). And what is a TCHAR? Well, depending on what compiler options you've set, it's either char or _wchar.

What the significance of the _ is escapes me. Another brain dead type from the idiots in Redmond.
Maybe it makes the wide char even _w_i_d_e_r_?
29  Using Arduino / Programming Questions / Re: Struct as argument on: April 06, 2014, 11:37:55 am
Quote
and it bugs the hell out of me!
typedefs are worse. Just what the hell is a LPCTSTR?
Hmm... LPC... the closest I can think of for that is Lars Pensj√∂'s C (predecessor to Dwarkin's Generic Driver).  STR is probably String, so that leaves the T...  Hmmm...  Towel...?

A string of towels defined in LPC?
30  Using Arduino / Project Guidance / Re: Horizontal printing with Serial.print/ln on: April 06, 2014, 11:16:32 am
It only goes to the next line when you use Serial.println().
Or use Serial.print('\n'); or print a string with a '\n' in it.
Well, yeah, but that's what Serial.println() does.
Pages: 1 [2] 3 4 ... 265