Hi All,
Just got started with Arduino, and I have to tell y'all, I love it! It's so accessible and fun to use, I have to say: KUDOS to the Arduino team on both the hardware and software sides!
Now, I have to admit being a very, very hardcore firmware guy who's done lots of C++ development in the embedded world (eg, Green Hills Embedded C++ for the ColdFire 68K series, Keil C51, QNX on MPC5200 PowerPC using Eclipse (aka "Momentics"), TONS of Visual Studio on Win32, etc). I was doing a non-PID (model-based) temperature controller and created a number of small classes to handle utility tasks such as keeping track of elapsed time (for scheduling occurrences in the loop() function), and for representing Celsius and Fahrenheit as fixed-point uint16_t fractions.
Much to my surprise, I reached a point, just when I was going to be about finished with my code, where I started to receive some really bogus compilation errors. For the first thing, the error pointers (line number in the source) didn't point to the line in question... it was goofed up. It was almost as if the errors were being generated by compiling a different source file!
Well, much to my chagrin, I find out that the Arduino environment is trying to be very tricky and "cool" behind the scenes, and is playing all kinds of games with "Wiring"... to make everyone's life easier. Easier, except for folks like me, who actually think they know what they are doing !
I did some research (googling!) and learned that using structs and classes seems to be most successful when you stash them in a separate *.H file and include that into your main code file. I did confirm that this does indeed work.
Now, what I'd like to know is this: is there a "wise guys' guide to hacking Arduino" for the complete dweebish weenie who doesn't need fancy tricks from the IDE? It would be cool if there were a FAQ or HOWTO for "folks who already are expert in C/C++ and want to have Arduineeish fun!"
Any such resources out there? TIA friends!
Cheers,
JoGusto
PS> And again, kudos to all involved. My post is NOT a criticism. Please... I love what you've done! No flames please.