Can't get Stalker v2.0 example code working on Arduino 1.0.1

Hi All,

I installed the Arduino IDE 1.0.1 today and was able to run some basic sketches on the stalker v2 I have, so programming works (with the uartsbee v3.1). However, I cannot get the example code to work (the example mentioned here: seeedstudio.com/wiki/Seeedui … e_Examples).

Whatever I do, it cannot compile and complains that a lot of stuff is not “declared in this scope”. It starts for example withe line in battery.cpp that sets the analogReference(INTERNAL). Compiler complains that INTERNAL is not declared.

I am guessing that I am doing something wrong with the location of the files, but dont know what.

Can somebody tell me where to put the cpp and .h files and the sketch? Mind you that I am using the latest Arduino IDE (the example mentions 0019 instead). And I running this on a Mac, but that seems to make no difference.

Any help is appreciated, because I would love the example to work so I can figure out how to use it for my own datalogging :slight_smile:

Ok, there have been changes to the base arduino libraries.

First, in any .cpp file that includes WProgram.h, change:

#include <WProgram.h>

to

#if ARDUINO < 100
#include <WProgram.h>
#else // ARDUINO
#include <Arduino.h>
#endif // ARDUINO

Second, Wire.h has changed, as per this excerpt from the Arduino documentation:

“As of Arduino 1.0, the library inherits from the Stream functions, making it consistent with other read/write libraries. Because of this, send() and receive() have been replaced with read() and write().”

So far, I have had to do a search and replace when I run across those. I do not yet have any good cpp magic going.