17 PWR.setSensorPower(SENS_3V3,SENS_ON);
19 pinMode(DIGITAL4 ,INPUT);
20 pinMode(DIGITAL5 ,INPUT);
21 pinMode(DIGITAL6 ,OUTPUT);
33 digitalWrite(DIGITAL6, HIGH);
35 level=PWR.getBatteryLevel();
36 digitalWrite(DIGITAL6, LOW);
43 USB.println(F(
"\t\-----------------------------------"));
44 USB.print(F(
"\t\ Show Struct from Node:"));
46 USB.print(F(
"\t\ BatteryLevel: "));
48 USB.print(F(
"\t\ extension: "));
50 USB.print(F(
"\t\ pitch1: "));
52 USB.print(F(
"\t\ roll1: "));
54 USB.print(F(
"\t\ pitch2: "));
56 USB.print(F(
"\t\ roll2: "));
58 USB.print(F(
"\t\ pitch3: "));
60 USB.print(F(
"\t\ roll3: "));
62 USB.print(F(
"\t\ temp1: "));
64 USB.print(F(
"\t\ temp2: "));
66 USB.print(F(
"\t\ temp3: "));
68 USB.println(F(
"\t\-----------------------------------"));
101 Utils.setLED(LED0, LED_OFF);
102 Utils.setLED(LED1, LED_OFF);
103 PWR.deepSleep(
"00:00:15:20",RTC_OFFSET,RTC_ALM1_MODE1,SOCKET0_OFF);
104 if( intFlag & RTC_INT ){
105 intFlag &= ~(RTC_INT);
113 PWR.setSensorPower(SENS_3V3,SENS_ON);
122 USB.println(
"runstate = SendDataRequest");
125 USB.print(
"\t\ datarequest has been ack from sensorstab ");
126 USB.println(
sensorID[currentNode],DEC);
130 USB.println(
"\t\ datarequest has NOT been ack from sensorstab ");
132 USB.println(
"\t\ Reached maximum number of tries -> not responding -> overjump");
135 if(currentNode !=
sizeof(
sensorID)-1){
136 USB.println(
"\t\ Not last sensor-node -> send data request to next sensor-node");
140 USB.println(
"\t\ Last Node -> change directly to runstate=sendServer");
145 USB.println(
"\t\ Is not responding");
155 USB.println(
"runstate = receive");
158 USB.println(
"\t\ data has been received");
161 if(currentNode ==
sizeof(
sensorID)-1){
178 USB.println(
"\t\ received ACK for Datarequest but no new data");
193 USB.println(
"runstate = SendServer");
203 USB.println(
"runstate = SendSleepCommand");
207 if(currentNode ==
sizeof(
sensorID)-1){
218 if(currentNode !=
sizeof(
sensorID)-1){
235 USB.println(
"runstate = Sleep");
244 USB.println(
"runstate = WakingUp");
uint8_t sendData(Sensors::structSensors *sensors)
This method sends all the sensor information from the struct to the webserver.
void BlinkAkku(uint8_t batLevel)
This method sets the button led on or in blink state for 5 seconds (depending on battery level) (bloc...
uint8_t measureBattery(void)
Sensors::structSensors mySensorStructArray[numberOfNodes]
uint8_t dataRequest(uint8_t ID)
uint8_t sendToServer(Sensors::structSensors *dataToSend)
void init()
This method initializes the output pins for the leds and clears both led.
uint8_t sendDeepSleep(uint8_t ID)
uint8_t sensorID[numberOfNodes]
void LedGreenOn()
This method turns the green led on.
uint8_t receiveNodeData(void)
void showStructContent(uint8_t node)
void convertStructBack(Sensors::structSensors *dest)
void LedGreenBlink4seconds()
This method lets the green led blink for 4 seconds (blocks program for 4s)
void init()
This method initializes the operator parameters that are necessary for 3G connection.
Class that handles the communication over 3G.
uint8_t sendSleep(uint8_t ID)
uint8_t receiveData(void)
uint8_t requestData(uint8_t ID)