Browse Source

oled dim

pull/22/head
Rysiek Labus 1 year ago
parent
commit
794045998c
  1. 8
      data_embed/index.html
  2. 2
      include/taskWebServer.h
  3. 18
      src/TTGO_T-Beam_LoRa_APRS.ino

8
data_embed/index.html

@ -89,11 +89,11 @@
</div>
<div>
<label for="aprs_lat_p">Latitude Preset</label>
<input class="u-full-width" type="text" minlength="0" name="aprs_lat_p" id="aprs_lat_p" title="latitude for fixed bicon">
<input class="u-full-width" type="text" minlength="0" name="aprs_lat_p" id="aprs_lat_p" title="latitude for fixed bicon, APRS format for example: 5215.0N">
</div>
<div>
<label for="aprs_lon_p">Longitude Preset</label>
<input class="u-full-width" type="text" minlength="0" name="aprs_lon_p" id="aprs_lon_p" title="longtitude for fixed bicon">
<input class="u-full-width" type="text" minlength="0" name="aprs_lon_p" id="aprs_lon_p" title="longtitude for fixed bicon, APRS format for example 02050.59E">
</div>
</div>
<div class="grid-container quarters">
@ -122,8 +122,8 @@
<input name="bt_enabled" id="bt_enabled" type="checkbox" value="1" title="enable or disable bluetooth">
</div>
<div>
<label for="oled_enabled">Oled display enabled</label>
<input name="oled_enabled" id="oled_enabled" type="checkbox" value="1" title="enable or disable oled lcd" DISABLED>
<label for="oled_enabled">Display dimmer enabled</label>
<input name="oled_enabled" id="oled_enabled" type="checkbox" value="1" title="enable or disable oled dimmer">
</div>
<div>
<label for="led_enable">LED signaling</label>

2
include/taskWebServer.h

@ -42,7 +42,7 @@ static const char *const PREF_APRS_SHOW_CMT_INIT = "show_cmt_init";
static const char *const PREF_DEV_BT_EN = "bt_enabled";
static const char *const PREF_DEV_BT_EN_INIT = "bt_enabled_init";
static const char *const PREF_DEV_OL_EN = "oled_enabled";
static const char *const PREF_DEV_OL_EN_INIT = "oled_enabled_init";
static const char *const PREF_DEV_OL_EN_INIT = "ol_enabled_init";
typedef struct {
String callsign;

18
src/TTGO_T-Beam_LoRa_APRS.ino

@ -318,6 +318,13 @@ void writedisplaytext(String HeaderTxt, String Line1, String Line2, String Line3
display.println(Line4);
display.setCursor(0,56);
display.println(Line5);
if (enabled_oled){
//axp.setPowerOutPut(AXP192_DCDC1, AXP202_ON); // enable oled
display.dim(true);
}else{
//axp.setPowerOutPut(AXP192_DCDC1, AXP202_OFF); // disable oled
display.dim(false);
}
display.display();
time_to_refresh = millis() + showRXTime;
}
@ -481,7 +488,6 @@ void setup(){
if(digitalRead(BUTTON)==LOW){
clear_preferences = 2;
}
}
if (!preferences.getBool(PREF_APRS_SHOW_CMT_INIT)){
@ -524,6 +530,8 @@ void setup(){
// Enable ADC to measure battery current, USB voltage etc.
axp.adc1Enable(0xfe, true);
axp.adc2Enable(0x80, true);
axp.setChgLEDMode(AXP20X_LED_OFF);
axp.setPowerOutPut(AXP192_DCDC1, AXP202_ON); // oled do not turn off
#endif
if(!display.begin(SSD1306_SWITCHCAPVCC, SSD1306_ADDRESS)) {
@ -604,14 +612,6 @@ void setup(){
time_to_refresh = millis() + showRXTime;
displayInvalidGPS();
digitalWrite(TXLED, HIGH);
#ifdef T_BEAM_V1_0
axp.setChgLEDMode(AXP20X_LED_OFF);
if (enabled_oled){
axp.setPowerOutPut(AXP192_DCDC1, AXP202_ON); // enable oled
}else{
axp.setPowerOutPut(AXP192_DCDC1, AXP202_OFF); // disable oled
}
#endif
}
// +---------------------------------------------------------------------+//

Loading…
Cancel
Save