Simple transmitter application for SX127x radio.

Dependencies:   MbedJSONValue SX127x sx12xx_hal

Files at this revision

API Documentation at this revision

Comitter:
corymast
Date:
Wed Oct 16 22:37:57 2019 +0000
Parent:
8:738ab96d41da
Commit message:
Added scaling for ADC to read between 0 and 100%.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 738ab96d41da -r b6e3ffbfeabd main.cpp
--- a/main.cpp	Fri Oct 11 18:42:47 2019 +0000
+++ b/main.cpp	Wed Oct 16 22:37:57 2019 +0000
@@ -101,7 +101,8 @@
     /* Fill the message */
     message["btn_count"] = seq; // Total number of button presses since boot.
     message["btn_timer"] = timer_button.read(); // Time since last button press.
-    message["light_val"] = light_val_analog; // Analog reading from light sensor
+    // Scale ADC value to 0-100%
+    message["light_val"] = light_val_analog * 100; // Analog reading from light sensor
     message["light_resistance"] = convert_analog_light_resistance(light_val_analog); // Light Sensor Resistance (Ohms)
     message["temperature"] = convert_analog_temperature(temperature_analog); // Temperature (F)
     message["my_str"] = "Hello World!"; // Sample String
@@ -196,7 +197,7 @@
     
     radio_init();
     
-    application_init(false);
+    application_init(true);
 
     for (;;)
     {