adds RSSI info

This commit is contained in:
Brendan Haines 2016-12-02 20:09:01 -07:00
parent 7f35b88b81
commit fd7491d8aa

View File

@ -21,6 +21,9 @@
// Time in miliseconds to stop listening for keypad input // Time in miliseconds to stop listening for keypad input
#define SLEEP_TIMEOUT 120000 #define SLEEP_TIMEOUT 120000
// RSSI value below which No Signal LED will light
#define RSSI_THRESHOLD
// Keypad pinout // Keypad pinout
byte rowPins[4] = {5, 10, 9, 7}; byte rowPins[4] = {5, 10, 9, 7};
byte colPins[3] = {6, 4, 8}; byte colPins[3] = {6, 4, 8};
@ -166,7 +169,7 @@ void loop() {
resumeDialtone(); resumeDialtone();
} }
// Battery Management // Indicator LEDs
uint16_t vbat; uint16_t vbat;
fona.getBattVoltage(&vbat); fona.getBattVoltage(&vbat);
if ( vbat < CHG_VLO ) { if ( vbat < CHG_VLO ) {
@ -174,6 +177,15 @@ void loop() {
} else { } else {
digitalWrite( LED_BAT_LOW, LOW ); digitalWrite( LED_BAT_LOW, LOW );
} }
uint8_t rssi;
rssi = fona.getRSSI();
if( rssi < RSSI_THRESHOLD ) {
digitalWrite( LED_NO_SIGNAL, HIGH );
} else {
digitalWrite( LED_NO_SIGNAL, LOW );
}
} else { } else {
// sleeping // sleeping
delay(100); delay(100);