32 pinMode(DIGITAL4 ,INPUT);
33 pinMode(DIGITAL5 ,INPUT);
34 pinMode(DIGITAL6 ,OUTPUT);
65 USB.println(
"\t\ activity detected");
72 USB.println(
"\t\ received dataRequest");
79 USB.println(
"\t\ send Packet succesful");
82 USB.println(
"*********************************************************");
83 USB.println(
"Statists:");
84 USB.print(
"Number of Succesful transmission");
86 USB.print(
"Number of Fails transmission");
88 USB.println(
"*********************************************************");
94 USB.print(
"\t\ Number of Fails transmission");
113 Utils.setLED(LED0, LED_OFF);
114 Utils.setLED(LED1, LED_OFF);
115 PWR.deepSleep(
"00:00:15:00",RTC_OFFSET,RTC_ALM1_MODE1,SOCKET0_OFF);
116 if( intFlag & RTC_INT ){
117 intFlag &= ~(RTC_INT);
125 switch(deepSleepState){
129 USB.println(
"\t\ activity detected");
135 USB.println(
"\t\ go to sleep");
157 uint8_t days = time / (60 * 60 * 24);
158 time -= days * (60 * 60 * 24);
159 uint8_t hours = time / (60 * 60);
160 time -= hours * (60 * 60);
161 uint8_t minutes = time / 60;
163 uint8_t seconds=time;
184 digitalWrite(DIGITAL6, HIGH);
186 level=PWR.getBatteryLevel();
187 digitalWrite(DIGITAL6, LOW);
197 USB.println(
"runstate = measure");
205 USB.println(
"runstate = sendToGateway");
218 USB.println(
"runstate = sleep");
225 USB.println(
"runstate = wakeUP");
void BlinkAkku(uint8_t batLevel)
This method sets the button led on or in blink state for 5 seconds (depending on battery level) (bloc...
void printAll()
This method reads all the sensors and prints them to the serial Port.
void wakeUp()
This method is used to wake up the Sensors, it initializes them.
void init()
This method initializes the output pins for the leds and clears both led.
void convertTime(uint32_t time)
uint8_t activityDetection(void)
void LedGreenOn()
This method turns the green led on.
uint8_t deepSleepCommand(void)
uint8_t measureBattery(void)
Sensors::structSensors mySensorStruct
void LedGreenBlink4seconds()
This method lets the green led blink for 4 seconds (blocks program for 4s)
uint8_t waitForDataRequest(void)
uint8_t getSensorValues(Sensors::structSensors *allSensors)
This method reads the pitch and Roll Angle- Values of all 3 Accelerometers, all 3 temperatures and th...
void goToSleep()
This method sets all sensors in Standby.
uint8_t waitForDeepSleep(void)
struct Lora::loraSettings mySettings
Class that handles the communication over 3G.
uint8_t makeMeasurment(void)
Class that handles sensors.
uint8_t sendDataToGateway(void)
void init()
This method initializes the sensors.