The battery and the coin cell are charged. The sensor conected to the agro-board are:
-preasure
-hummidity and tempreature
-wind direction
-wind speed
-rain
-soil temperature
-leaf wetness
-1 soil moisture
mi main code is this:
Code:
void setup()
{
int i = 0;
xbeeZB.init(ZIGBEE,FREQ2_4G,NORMAL);
// Powers XBee
xbeeZB.ON();
xbeeZB.setAPSencryption(XBEE_ON);
xbeeZB.getOwnMacLow();
Utils.hex2str(xbeeZB.sourceMacLow, myMac);
delay(2000);
}
void loop()
{
char macDest[17];
SensorAgr.setBoardMode(SENS_ON);
//capture the data from sensors
readSoil();
readWeather();
readPlant();
readClimate();
toSleep();
}
and the fuction to sleep is:
Code:
void toSleep()
{
RTC.ON();
//Y:m:d:nd:H:m:s
RTC.setTime("12:01:01:07:00:00:00");
// Go to sleep disconnecting all the switches and modules
// After 15 minutes, Waspmote wakes up thanks to the RTC Alarm
SensorAgr.setBoardMode(SENS_OFF);
PWR.deepSleep("00:00:15:00",RTC_OFFSET,RTC_ALM1_MODE1,ALL_OFF);
if( intFlag & RTC_INT )
{
intFlag &= ~(RTC_INT);
}
}
Regards
