Cayenne Low Power Payload

Dependents:   LORAWAN-TTN-CAYENNE-LM35 ER4Lora gps_accelerometer sgam_mdw_test ... more

Revision:
3:a65959c9e3b9
Parent:
2:ac824f095591
Child:
4:8d32c35e74ad
diff -r ac824f095591 -r a65959c9e3b9 README.md
--- a/README.md	Fri Dec 02 17:00:21 2016 +0000
+++ b/README.md	Fri Dec 02 17:11:01 2016 +0000
@@ -10,16 +10,29 @@
 
 CayenneLPP Payload(MAX_SIZE);
 
-float temp = -4.1;
+float celsius = -4.1;
 float accel[] = {1.234, -1.234, 0};
 float rh = 30;
-float bp = 1014.1;
+float hpa = 1014.1;
+
+int size = 0;
 
 Payload.reset();
-Payload.addTemperature(0, temp);
+size = Payload.addTemperature(0, celsius);
+
+if (size == 0) {
+    // not enough byte left to add the data
+}
+
+else {
+    // add function returned current payload size
+}
+
+
 Payload.addAccelerometer(1, accel[0], accel[1], accel[2]);
 Payload.addRelativeHumidity(3, rh);
-Payload.addBarometricPressure(4, bp);
+Payload.addBarometricPressure(4, hpa);
 
+// Call LoRaWAN library to send the frame
 LORA_SEND(Payload.getBuffer(), Payload.getSize());
 ```
\ No newline at end of file