ss_oled update (now working)
This commit is contained in:
parent
c65c32275e
commit
6d7b392620
@ -58,7 +58,8 @@ lib_deps_lora =
|
||||
;MCCI LoRaWAN LMIC library@>=3.0.99 ; MCCI LMIC by Terrill Moore
|
||||
https://github.com/mcci-catena/arduino-lmic.git#5322dd1
|
||||
lib_deps_display =
|
||||
ss_oled@=3.1.0
|
||||
;ss_oled@=3.1.0
|
||||
https://github.com/bitbank2/ss_oled.git#a5fbee4
|
||||
BitBang_I2C@>=1.2.0
|
||||
QRCode@>=0.0.1
|
||||
lib_deps_matrix_display =
|
||||
|
@ -57,6 +57,7 @@ const char *printmonth[] = {"xxx", "Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
||||
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
|
||||
uint8_t DisplayIsOn = 0;
|
||||
uint8_t displaybuf[DISPLAY_WIDTH * DISPLAY_HEIGHT / 8] = {0};
|
||||
static uint8_t plotbuf[DISPLAY_WIDTH * DISPLAY_HEIGHT / 8] = {0};
|
||||
|
||||
QRCode qrcode;
|
||||
|
||||
@ -298,7 +299,7 @@ void draw_page(time_t t, uint8_t page) {
|
||||
|
||||
// page 1: pax graph
|
||||
case 1:
|
||||
oledDumpBuffer(displaybuf);
|
||||
oledDumpBuffer(plotbuf);
|
||||
break; // page1
|
||||
|
||||
// page 2: GPS
|
||||
@ -502,24 +503,22 @@ void oledPlotCurve(uint16_t count, bool reset) {
|
||||
if (col < DISPLAY_WIDTH - 1) // matrix not full -> increment column
|
||||
col++;
|
||||
else // matrix full -> scroll left 1 dot
|
||||
oledScrollBufferHorizontal(displaybuf, DISPLAY_WIDTH, DISPLAY_HEIGHT,
|
||||
true);
|
||||
oledScrollBufferHorizontal(plotbuf, DISPLAY_WIDTH, DISPLAY_HEIGHT, true);
|
||||
|
||||
} else // clear current dot
|
||||
oledDrawPixel(displaybuf, col, row, 0);
|
||||
oledDrawPixel(plotbuf, col, row, 0);
|
||||
|
||||
// scroll down, if necessary
|
||||
while ((count - v_scroll) > DISPLAY_HEIGHT - 1)
|
||||
v_scroll++;
|
||||
if (v_scroll)
|
||||
oledScrollBufferVertical(displaybuf, DISPLAY_WIDTH, DISPLAY_HEIGHT,
|
||||
v_scroll);
|
||||
oledScrollBufferVertical(plotbuf, DISPLAY_WIDTH, DISPLAY_HEIGHT, v_scroll);
|
||||
|
||||
// set new dot
|
||||
// row = DISPLAY_HEIGHT - 1 - (count - v_scroll) % DISPLAY_HEIGHT;
|
||||
row = DISPLAY_HEIGHT - 1 - count - v_scroll;
|
||||
last_count = count;
|
||||
oledDrawPixel(displaybuf, col, row, 1);
|
||||
oledDrawPixel(plotbuf, col, row, 1);
|
||||
}
|
||||
|
||||
#endif // HAS_DISPLAY
|
Loading…
Reference in New Issue
Block a user