I have been working with the Seeeduino Stalker for a couple of weeks and thought I would pass on what I have learned about it. I bought mine from Robotshop, I also bought a Seeedstudio UartSB V2.2 USB to Serial module to interface with it. Info can be found at:
http://www.robotshop.com/seeedstudio-stalker-wireless-sensor-network-node.html
http://www.robotshop.com/seeedstudio-uartsb-v2-2-usb-to-serial.html
I've noticed that the documentation and demo sketches for the Stalker is somewhat sparse so I am going to post some of the code I have been working on here. I will start with a rework of the demo code that is supplied with the Stalker. I will follow up with more sketches as time permits.
#include "FileLogger.h" // http://code.google.com/p/arduino-filelogger/
#include <Time.h>
#include <Wire.h>
#include <DS1307RTC.h> // a basic DS1307 library - http://www.arduino.cc/playground/Code/Time
byte start[7]= {
'B','e','g','i','n',0x0D,0x0A};
byte Buffer[23]; //Buffer for printing to SD card
int temp; //temp test data
time_t oldtime=0; //last time loop has ran
int result; //status of SD card write - 0 = "OK", 1 = "Fail initializing", 2 = "Fail appending"
unsigned long loggingRate=5; //logging rate in seconds
int length; //length of buffer string
void setup(void)
{
do
{
result = FileLogger::append("data.txt", start, 7);//Initialize the SD Card
}
while(result != 0);
// the next two lines can be removed if the RTC has been set
// setTime(17,05,0,1,3,10); // set time to 17:05:00 1 Mar 2010 (see below)
// RTC.set(now()); // set the RTC to the current time (set in the previous line)
// format for setting time - setTime(hr,min,sec,day,month,yr);
setSyncProvider(RTC.get); // the function to get the time from the RTC
Serial.begin(9600); //initialize serial port
}
void loop(void)
{
//if( now() >= oldtime + loggingRate) //proceed with loop if loggingRate seconds have elapsed
if(minute() != oldtime) //use this if 1 minute intervals is desired
{
//oldtime = now(); //use this if loggingRate seconds is desired
oldtime = minute(); //use this if 1 minute intervals is desired
do
{
temp=month();
Buffer[0]=(temp/10)+'0';
Buffer[1]=(temp%10)+'0';
Buffer[2]='/';
temp=day();
Buffer[3]=(temp/10)+'0';
Buffer[4]=(temp%10)+'0';
Buffer[5]='/';
temp=year();
Buffer[6]=((temp-2000)/10)+'0';
Buffer[7]=((temp-2000)%10)+'0';
Buffer[8]=' ';
temp=hour();
Buffer[9]=(temp/10)+'0';
Buffer[10]=(temp%10)+'0';
Buffer[11]=':';
temp=minute();
Buffer[12]=(temp/10)+'0';
Buffer[13]=(temp%10)+'0';
Buffer[14]=':';
temp=second();
Buffer[15]=(temp/10)+'0';
Buffer[16]=(temp%10)+'0';
Buffer[17]=' ';
temp=999;
Buffer[18]=(temp/100)+'0';
Buffer[19]=((temp%100)/10)+'0';
Buffer[20]=(temp%10)+'0';
Buffer[21]=0x0D;
Buffer[22]=0x0A;
length=sizeof(Buffer);
result = FileLogger::append("data.txt", Buffer, length); //write data to SD card
}
while( result != 0); //repeat loop until successful write to SD card
for (int i=0; i < length ;i++) {
Serial.print(Buffer[i]); //Serial print buffer string to serial monitor or xBee
}
}
}

