-
Notifications
You must be signed in to change notification settings - Fork 214
Tips
Calvin Hass edited this page May 17, 2020
·
5 revisions
This page is under development. Please check back again later!
// Detect encoder transition events
bool bInc = false;
bool bDec = false;
int32_t newPosition = myEnc.read();
if (newPosition != oldPosition) {
if (newPosition > oldPosition) { bInc = true; }
else { bDec = true; }
oldPosition = newPosition;
}
if (bInc) { // Increment
m_nCurPage = (m_nCurPage < MAX_PAGE-1)? m_nCurPage+1 : m_nCurPage;
gslc_SetPageCur(&m_gui,m_nCurPage);
} else if (bDec) { // Decrement
m_nCurPage = (m_nCurPage > 0)? m_nCurPage-1 : m_nCurPage;
gslc_SetPageCur(&m_gui,m_nCurPage);
}
TBD - list of font support options per driver / platform
- All examples require
#include "Arduino.h"
in their header in order for ESP32 to work. (Thanks to @shafr)