16#include <Adafruit_GFX.h>
17#include <Fonts/Picopixel.h>
26#include "Adafruit_SH1106.h"
28#include <Adafruit_SSD1306.h>
51 const __FlashStringHelper*
percentArray[10] = {F(
"10%"), F(
"20%"), F(
"30%"), F(
"40%"), F(
"50%"), F(
"60%"), F(
"70%"), F(
"80%"), F(
"90%"), F(
"100%")};
52 const __FlashStringHelper*
effectArray[10] = {F(
"NONE"), F(
"PHASEY"), F(
"PHASEX"), F(
"PHASER"), F(
"GLITCHX"), F(
"MAGNET"), F(
"FISHEYE"), F(
"BLURH"), F(
"BLURV"), F(
"BLURR")};
53 const __FlashStringHelper*
colorArray[10] = {F(
"GRDIENT"), F(
"YELLOW"), F(
"ORANGE"), F(
"WHITE"), F(
"GREEN"), F(
"PURPLE"), F(
"RED"), F(
"BLUE"), F(
"RAINBOW"), F(
"NOISE")};
54 const __FlashStringHelper*
onOffArray[2] = {F(
"OFFLINE"), F(
"ONLINE")};
55 const __FlashStringHelper*
hueArray[10] = {F(
"0 DEG"), F(
"36 DEG"), F(
"72 DEG"), F(
"108 DEG"), F(
"144 DEG"), F(
"180 DEG"), F(
"216 DEG"), F(
"252 DEG"), F(
"288 DEG"), F(
"324 DEG")};
56 const __FlashStringHelper*
faceArray[10] = {F(
"DEFAULT"), F(
"ANGRY"), F(
"DOUBT"), F(
"FROWN"), F(
"LOOKUP"), F(
"SAD"), F(
"AUDIO1"), F(
"AUDIO2"), F(
"AUDIO3")};
Defines the base Effect class for applying transformations or effects to pixel groups.
Provides a collection of mathematical utility functions and constants.
Utility class for timing operations based on a set frequency.
User-configurable settings for the project.
Effect()
Default constructor for the Effect class.
void SetEffect(Effect *effect)
Sets the sub-effect to be applied to the display.
static const uint8_t faceYMaxPosition
Maximum Y position for face rendering.
static const uint16_t SCREEN_HEIGHT
Height of the OLED screen.
static const uint8_t faceXMinPosition
Minimum X position for face rendering.
void ApplyEffect(IPixelGroup *pixelGroup)
Applies the effect to the specified pixel group.
void UpdateFaceInformation()
Updates face rendering information.
const __FlashStringHelper * hueArray[10]
Hue options.
bool useExternalFace
To decide if it uses faceArray or faceNames for the face.
static uint8_t faceBitmap[bufferSize]
Background template for displaying the grids.
static const int bufferSize
Buffer size for display rendering.
static const uint8_t faceYMinPosition
Minimum Y position for face rendering.
bool splashFinished
True when the splash startup screen is finished.
const __FlashStringHelper * colorArray[10]
const __FlashStringHelper * faceArray[10]
Face names.
TimeStep timeStep
Limits the display to update 5 times per second.
const IPixelGroup * facePixels
const __FlashStringHelper * effectArray[10]
static const uint16_t SCREEN_WIDTH
Width of the OLED screen.
void SetFaceMin(Vector2D faceMin)
Sets the minimum face rendering coordinates.
void Initialize()
Initializes the display and related components.
Effect * subEffect
Used to capture the complete rendered frame.
static const uint8_t CoelaSplash[]
static const uint8_t faceXMaxPosition
Maximum X position for face rendering.
void SetFacePixelArray(const IPixelGroup *pixelGroup)
Sets the face pixel array so it's not drawn to the HUD.
void EnableBitFaceRender(float xIn, float yIn)
Enables rendering for a bitmap face within specified coordinates.
const __FlashStringHelper ** faceNames
Names of each face to be displayed on the screen.
void SetFaceMax(Vector2D faceMax)
Sets the maximum face rendering coordinates.
static Adafruit_SSD1306 display
static const int8_t OLED_RESET
Reset pin for the display.
static const uint8_t FaceTemplate[]
const __FlashStringHelper * onOffArray[2]
Online/Offline statuses.
void CheckInvertPrintText(int16_t x, int16_t y, uint8_t menu, const String &str)
Prints text conditionally inverted based on menu selection.
uint32_t startMillis
Start time of the display for the splash screen.
Vector2D faceMax
Maximum coordinate for face on display.
static const uint32_t splashTime
Duration for splash screen in milliseconds.
void ResetDisplayBuffer()
Resets the display buffer to a blank state.
void ResetI2CBus()
Resets the I2C bus in case of communication errors.
const __FlashStringHelper * percentArray[10]
Battery percentages.
static const uint8_t PrototracerSplash[]
bool didBegin
True if the I2C interface started correctly.
Vector2D faceMin
Minimum coordinate for face on display.
void Update()
Updates the display content based on the current state.
HeadsUpDisplay(Vector2D faceMin, Vector2D faceMax)
Constructs a HeadsUpDisplay with face rendering boundaries.
void SetFaceArray(const __FlashStringHelper **faceNames)
Sets the array of face names.
Interface for managing and interacting with a collection of pixels.
Provides a mechanism to trigger actions at a specified frequency.
Represents a 2D vector (X, Y) and provides methods for vector arithmetic.