Edzelf / ESP32-Radio

Internet radio based on ESP32, VS1053 and a TFT screen.
GNU General Public License v3.0
990 stars 228 forks source link

Use bat0, bat100 to display RSSI #499

Open kondorcl opened 2 years ago

kondorcl commented 2 years ago

I use Display remaining battery capacity for display wifi rssi.

In preferences: bat0 = 0 # rssi = -80 bat100 = 100 # rssi = -30

void spftask ( void parameter ) { while ( true ) { handle_spec() ; // Maybe some special funcs? vTaskDelay ( 100 / portTICK_PERIOD_MS ) ; // Pause for a short time //adcval = ( 15 adcval + // Read ADC and do some filtering //adc1_get_raw ( ADC1_CHANNEL_0 ) ) / 16 ; int rssi = WiFi.RSSI(); adcval = map(rssi, -80, -30, 0, 100); } //vTaskDelete ( NULL ) ; // Will never arrive here }

Regards, ERamirez CL