ThingPulse / esp8266-oled-ssd1306

Driver for the SSD1306 and SH1106 based 128x64, 128x32, 64x48 pixel OLED display running on ESP8266/ESP32
https://thingpulse.com
Other
1.98k stars 636 forks source link

With fixed overlay and division by zero fixed #358

Open BbIKTOP opened 2 years ago

BbIKTOP commented 2 years ago

Resolves #356:

3 methods added to the API:

void setFixedOverlay(FixedOverlayCallback fixedOverlayCallback) to set fixed overlay drawing foo.

void setFixedOverlayFrames(const FrameCallback* fixedOverlayFramesList, int noOverlayFramesCount) to set the list of frames on which this fixed overlay will be drawn (by specifying frames callbacks, which could be useful during list changes).

void setFixedOverlayFrames(int* fixedOverlayFramesList, int noOverlayFramesCount) to set the list of frames on which this fixed overlay will be drawn (by specifying frames numbers)

Usage example:

FrameCallback frames[] =
    {
        frame1,
        frame2,
        frame3,
        frame4,
        frame5};
int framesCount = 5;

...

    ui.setFixedOverlay(someOverlayFoo);
    ui.setFixedOverlayFrames((const FrameCallback[]){frame2, frame3, frame5}, 3);
// or
    ui.setFixedOverlayFrames((const uint8_t[]){1, 2, 4}, 3);
marcelstoer commented 2 years ago

Looking good, thanks! Please add an example sketch that demonstrates how to use this and some documentation to the README. Maybe an animated GIF for the README?