This will be a sming library for esp8266, for showing multiple info screens with data on them, that refreshes automaticaly for you onscreen (currently ssd1306)
Based on sming: https://github.com/SmingHub/Sming
Screen (I2C):
sclPin 5
sdaPin 6
Button 0
Create extended display
//* SSD1306 - I2C
Extended_SSD1306 display(4);
//Declare InfoScreens
InfoScreens *infos;
// Add a new Page
InfoPage* p1 = infos->createPage("Main", "Main");
//Add a header line (its just a regular line)
InfoLine* el = p1->createLine("header1", "P1Test");
//add a time paramater (data that can be updated whenever)
el->addParam("time", currentTime)->t.x = getXOnScreenForString(currentTime, 1);
p1->createLine("time2", "time:")->addParam("time", currentTime)->t.x = getXOnScreenForString(currentTime, 1);
InfoPage* p2 = infos->createPage("P2", "P2");
InfoLine* el2 = p2->createLine("header2", "P2Test");
//add the time param
el2->addParam("time", currentTime)->t.x = getXOnScreenForString(currentTime, 1);
p2->createLine("4", "sta:")->addParam("station", "0.0.0.0");
InfoLine* el22 = p2->createLine("2", "apdd: ");
el22->addParam("ap", "0.0.0.0");
InfoPage* p3 = infos->createPage("P3", "P3");
p3->createLine("header3", "P3Test")->addParam("time", currentTime)->t.x = getXOnScreenForString(currentTime, 1);
p3->createLine("4", "ap:")->addParam("ap", "0.0.0.0");
infos->show();
void handleUpdateTimer() {
currentTime = SystemClock.now().toShortTimeString(true);
infos->updateParamValue("time", currentTime);
}
infos->moveRight();
infos->moveLeft();
Click - move to next Screen DoubleClick - move to previous Screen Click and hold - Rapid fore (100ms) of move to next screen
This button implementation can sense:
- Click
- Double Click
If enablePressAndHold = true then if button is still pressed after click, it will send a click event every 100ms
if enablePressAndHold = false then lib will detect: 3. Long click - no Click events fired 4. Hold click - no Click events fired
MultiFunctionButton(int buttonPin, ButtonActionDelegate handler)
MultiFunctionButton(int buttonPin)
void onButtonEvent(ButtonActionDelegate handler)