MCPcopy Create free account
hub / github.com/cifertech/nRFBox / displayMenu

Function displayMenu

nRFBox_V2/setting.cpp:82–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82void displayMenu() {
83 u8g2.clearBuffer();
84
85 // Draw menu header
86 u8g2.setFont(u8g2_font_6x10_tf);
87 u8g2.drawStr(0, 10, "Settings Menu");
88
89 // Draw menu options
90 if (currentOption == 0) {
91 u8g2.drawStr(0, 25, "> NeoPixel: ");
92 } else {
93 u8g2.drawStr(0, 25, " NeoPixel: ");
94 }
95
96 if (currentOption == 1) {
97 u8g2.drawStr(0, 40, "> Brightness: ");
98 } else {
99 u8g2.drawStr(0, 40, " Brightness: ");
100 }
101
102 // Show current settings
103 u8g2.setCursor(80, 25);
104 u8g2.print(neoPixelActive ? "Enabled" : "Disabled");
105
106 u8g2.setCursor(80, 40);
107 uint8_t brightnessPercent = map(oledBrightness, 0, 255, 0, 100);
108 u8g2.print(brightnessPercent);
109 u8g2.print("%");
110
111 u8g2.sendBuffer();
112}
113
114void settingSetup() {
115 Serial.begin(115200);

Callers 1

settingLoopFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected