contain lorawan with serial_rx enabled
Dependencies: pulga-lorawan-drv SPI_MX25R Si1133 BME280
Diff: main.cpp
- Revision:
- 60:c4f9e9202fb4
- Parent:
- 59:a4fc1efb1569
- Child:
- 61:65744bc8ab55
--- a/main.cpp Tue Dec 10 13:08:45 2019 +0000 +++ b/main.cpp Mon Nov 30 19:25:11 2020 +0000 @@ -60,7 +60,7 @@ * Dummy sensor class object */ //DS1820 ds1820(PC_9); -BME280 sensor_amb(P0_13, P0_15, 0x77 << 1) ; +//BME280 sensor_amb(P0_13, P0_15, 0x77 << 1) ; /** * Sensors Variables @@ -100,8 +100,8 @@ * Entry point for application */ -mbed::DigitalOut _alive_led(P1_13, 1); -mbed::DigitalOut _actuated_led(P1_14,0); +mbed::DigitalOut _alive_led(P1_13, 0); +mbed::DigitalOut _actuated_led(P1_14,1); int main(void) { @@ -152,7 +152,7 @@ printf("\r\n Connection - In Progress ...\r\n"); -_actuated_led =1; +_actuated_led =0; // make your event queue dispatching events forever ev_queue.dispatch_forever(); @@ -167,24 +167,8 @@ uint16_t packet_len; int16_t retcode; int32_t sensor_value; - - /* if (ds1820.begin()) { - ds1820.startConversion(); - sensor_value = ds1820.read(); - printf("\r\n Dummy Sensor Value = %d \r\n", sensor_value); - ds1820.startConversion(); - sensor_value++; - - } else { - printf("\r\n No sensor found \r\n"); - return; - }*/ - sensor_amb.initialize(); - sensor_get = sensor_amb.getTemperature(); - - packet_len = sprintf((char *) tx_buffer, "Temperature Sensor Value is %d", - sensor_get); + packet_len = sprintf((char *) tx_buffer, "Sensor Value is 10.0\n"); retcode = lorawan.send(MBED_CONF_LORA_APP_PORT, tx_buffer, packet_len, MSG_UNCONFIRMED_FLAG);