-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDisplay.cpp
More file actions
36 lines (28 loc) · 767 Bytes
/
Display.cpp
File metadata and controls
36 lines (28 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include "Display.h"
#include "config.h"
Display::Display(U8G2 *u8g2) : u8g2(u8g2) {}
void Display::begin()
{
u8g2->begin();
}
void Display::print(DisplayState *state)
{
u8g2->clearBuffer();
u8g2->setFont(u8g2_font_siji_t_6x10); // 12x12
u8g2->setCursor(0, 12);
u8g2->print(F("eui-"));
u8g2->print(state->devEUI, HEX);
u8g2->setCursor(0, 28);
u8g2->print(F("Joined?: "));
u8g2->print(state->isJoined ? F("Yes") : F("No"));
u8g2->setCursor(0, 44);
u8g2->print(F("FCntUp: "));
u8g2->print(state->fcntUp);
#ifdef USE_HELTEC_BATTERY
u8g2->setCursor(0, 60);
u8g2->print(F("Battery: "));
u8g2->print(state->batteryVoltage);
u8g2->print(F(" V"));
#endif // USE_HELTEC_BATTERY
u8g2->sendBuffer();
}