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: libmDot-mbed5 DOGS102 ISL29011 MMA845x MPL3115A2 NCP5623B X_NUCLEO_IKS01A1 Senet_Packet
Fork of MTDOT-UDKDemo_Senet by
Diff: main.cpp
- Revision:
- 16:7b3cc3221db1
- Parent:
- 14:07ff01da6bbf
- Child:
- 18:856ebfac428b
--- a/main.cpp Wed Aug 24 13:59:39 2016 -0400
+++ b/main.cpp Wed Aug 24 18:14:11 2016 +0000
@@ -98,7 +98,7 @@
BoardSensorData() { init(); }
};
-#ifdef MDOT_EVB
+#ifdef MTDOT_EVB
//DigitalIn mDot02(PA_2); // GPIO/UART_TX
//DigitalOut mDot03(PA_3); // GPIO/UART_RX
@@ -136,8 +136,7 @@
* LoRaWAN Configuration
*/
static uint8_t app_id[8] = {0x00,0x25,0x0C,0x00,0x00,0x01,0x00,0x01};
-static uint8_t app_key[16] = {0x9F,0x93,0xDC,0xEB,0xAC,0x2F,0x4F,0xEE,0x80,0x3C,0x05,0x7A,0x54,0x8E,0x44,0x99};
-
+static uint8_t app_key[16] = {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F};
static std::vector<uint8_t> config_app_id(app_id,app_id+sizeof(app_id)/sizeof(uint8_t));
static std::vector<uint8_t> config_app_key(app_key,app_key+sizeof(app_key)/sizeof(uint8_t));
static uint8_t config_frequency_sub_band = 0;
@@ -237,7 +236,7 @@
}
}
-#ifdef MDOT_EVB
+#ifdef MTDOT_EVB
void ReceiveData(std::vector<uint8_t> frame)
{
@@ -425,9 +424,9 @@
sprintf(txtstr, "z = %d", accel_data._z );
evbLCD->writeText(20,3,font_6x8,txtstr,strlen(txtstr));
- sensorData->accel_x = accel_data._x;
- sensorData->accel_y = accel_data._y;
- sensorData->accel_z = accel_data._z;
+ sensorData.accel_x = accel_data._x;
+ sensorData.accel_y = accel_data._y;
+ sensorData.accel_z = accel_data._z;
// Update accelerometer state
evbLCD->startUpdate();
@@ -453,7 +452,7 @@
position_value= 0x00;
}
- if(changed)
+ if(position_changed)
evbBackLight->setLEDCurrent(0);
/*
* Trigger a Pressure reading
@@ -507,7 +506,7 @@
evbLCD->writeText(0,5,font_6x8,txtstr,strlen(txtstr));
num_whole = baro_data._temp / 16; // 8 bit signed significant integer
num_frac = (baro_data._temp & 0x0F) * 625 / 100; // 4 bit fractional .0625 per bit
- sensor.temperature = num_whole + ((float)num_frac / 100);
+ sensorData.temperature = num_whole + ((float)num_frac / 100);
sprintf(txtstr,"Temp=%ld.%03d C", num_whole, num_frac);
evbLCD->writeText(0,6,font_6x8,txtstr,strlen(txtstr));
@@ -521,7 +520,6 @@
evbLCD->writeText(0,7,font_6x8,txtstr,strlen(txtstr));
evbLCD->endUpdate();
- printf("finished iteration %d\n\r",(++i));
}
uint32_t PrepareFrame(std::vector<uint8_t> &frame, BoardSensorData &data)
@@ -850,7 +848,7 @@
mdot_radio->setAntennaGain(-3);
// Setting up LED1 as activity LED
-#ifdef MDOT_EVB
+#ifdef MTDOT_EVB
mdot_radio->setActivityLedPin(PB_0);
mdot_radio->setActivityLedEnable(true);
#endif
