Add U8X8 carousel screens
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#ifndef CAROUSEL_H
|
||||
#define CAROUSEL_H
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <U8g2lib.h>
|
||||
|
||||
#include "screens.h"
|
||||
|
||||
class Carousel {
|
||||
public:
|
||||
Carousel(Screen *screens, size_t screenCount);
|
||||
|
||||
void begin(unsigned long now);
|
||||
void update(unsigned long now);
|
||||
void next(unsigned long now);
|
||||
void render(U8X8 &display) const;
|
||||
bool consumeDirty();
|
||||
|
||||
private:
|
||||
Screen *screens_;
|
||||
size_t screenCount_;
|
||||
size_t currentIndex_;
|
||||
unsigned long nextAutoAdvanceAt_;
|
||||
unsigned long manualModeUntil_;
|
||||
bool dirty_;
|
||||
|
||||
void scheduleNextAdvance(unsigned long now);
|
||||
void drawIndicators(U8X8 &display) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user