Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BME280
Revision 63:7b4427c6bded, committed 2020-10-05
- Comitter:
- jorgehsmp
- Date:
- Mon Oct 05 15:32:48 2020 +0000
- Parent:
- 62:078d66d985f8
- Commit message:
- BMP280 LoRaWAN Node
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat Jul 25 17:46:37 2020 +0000
+++ b/main.cpp Mon Oct 05 15:32:48 2020 +0000
@@ -27,7 +27,7 @@
#define CONFIRMED_MSG_RETRY_COUNTER 3
#define DEBUG 1
-#define BUFFER_SIZE 12
+#define BUFFER_SIZE 8
// Max payload size can be LORAMAC_PHY_MAXPAYLOAD.
@@ -38,7 +38,7 @@
BME280 sensor(PB_9, PB_8, 0x77);
uint16_t packet_len = BUFFER_SIZE;
-float sensor_values[3];
+float sensor_values[2];
/**
@@ -141,7 +141,7 @@
sensor.trigger();
sensor_values[0] = sensor.getTemperature();
sensor_values[1] = sensor.getPressure();
- sensor_values[2] = sensor.getHumidity();
+ //sensor_values[2] = sensor.getHumidity();
memcpy(tx_buffer, sensor_values, packet_len);
@@ -163,6 +163,9 @@
}
if(DEBUG)
+ printf("\r\n Temp: %f \r\n", sensor_values[0]);
+ printf("\r\n Pressure: %f \r\n", sensor_values[1]);
+ printf("\r\n txBuffer: %.2X %.2X %.2X %.2X %.2X %.2X %.2X %.2X \r\n", tx_buffer[0], tx_buffer[1], tx_buffer[2], tx_buffer[3], tx_buffer[4], tx_buffer[5], tx_buffer[6], tx_buffer[7]);
printf("\r\n %d bytes scheduled for transmission \r\n", retcode);
//Check if radio wakes up automatically. If not, then call radio.TX();