Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion GNC255/GNC255.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ void GNC255::set(int16_t messageID, const char *data)
case 5: // set COM/NAV mode
setMode(strcmp(data, "0") == 0);
break;
case 6: // set contrast (brightness) of OLED
setContrast(atoi(data));
break;
default:
break;
}
Expand Down Expand Up @@ -164,4 +167,9 @@ void GNC255::_renderLabel(const char *text, Label label, Position offset, bool u

_oledDisplay->print(text);
if (update) _oledDisplay->sendBuffer();
}
}

void GNC255::setContrast(uint8_t displayContrast)
{
_oledDisplay->setContrast(displayContrast);
}
2 changes: 2 additions & 0 deletions GNC255/GNC255.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class GNC255
bool _hasChanged;
char activeFrequency[8] = "123.456";
char standbyFrequency[8] = "123.456";
uint8_t displayContrast = 32;

void _update();
void _stop();
Expand All @@ -53,4 +54,5 @@ class GNC255
void updateActiveLabel(const char *frequency);
void updateStandbyLabel(const char *frequency);
void _renderLabel(const char *text, Label label, Position offset, bool update = false);
void setContrast(uint8_t displayContrast);
};