|
DIY QlockTwo
Perfect DIY version of famous QlockTwo Classic with ESP8266
|
#include <Arduino.h>#include <Ticker.h>#include "LedControlModule.h"#include "ClockModule.h"#include "WifiModule.h"#include "Settings.h"#include "AceButton.h"#include "SimpleTime.h"#include "ConfigModule.h"Go to the source code of this file.
Functions | |
| NeoTopology< MyPanelLayout > | topo (PANEL_WIDTH, PANEL_HEIGHT) |
| NeoPixelBusType | pixelStrip (PIXEL_COUNT) |
| AceButton | buttonOne (new ButtonConfig()) |
| AceButton | buttonTwo (new ButtonConfig()) |
| AceButton | buttonThree (new ButtonConfig()) |
| AceButton | buttonFour (new ButtonConfig()) |
| void | handleButtonOneEvent (AceButton *button, uint8_t eventType, uint8_t buttonState) |
| Handle clicks of 1. More... | |
| void | handleButtonTwoEvent (AceButton *button, uint8_t eventType, uint8_t buttonState) |
| Handle clicks of 2. More... | |
| void | handleButtonThreeEvent (AceButton *button, uint8_t eventType, uint8_t buttonState) |
| Handle clicks of 3. More... | |
| void | handleButtonFourEvent (AceButton *button, uint8_t eventType, uint8_t buttonState) |
| Handle clicks of 4. More... | |
| void | updateClock () |
| Connect to Wifi and update RTC over NTP. More... | |
| void | updateLedColor () |
| Apply ambient light by dimming currentLedColor. More... | |
| void | setButtonConfig (ButtonConfig *buttonConfig, ButtonConfig::EventHandler eventHandler) |
| Setup Event Handlers of a Button. More... | |
| void | setupButtons () |
| Setup all four Buttons. More... | |
| void | showTime () |
| Get Time from RTC and update if it is not correct from NTP. More... | |
| void | configModeCallback (WiFiManager *myWiFiManager) |
| Gets called when WiFiManager enters configuration mode. More... | |
| void | saveConfigCallback () |
| Gets called when WifiManager when custom parameters have been set AND a connection has been established. More... | |
| void | setup () |
| Setup all Modules. More... | |
| void | loop () |
| Main Loop. More... | |
Variables | |
| LedControlModule | ledControlModule (topo) |
| ClockModule | clockModule (Wire, LOCAL_TIMEZONE, NTP_SERVER_NAME) |
| WifiModule | wifiModule (DEVICE_NAME) |
| ConfigModule | configModule (CONFIG_FILE_PATH) |
| unsigned long | lastClockUpdate = 0 |
| unsigned long | lastShowTime = 0 |
| bool | showTimeDisabled = false |
| int | currentLedColorId = 0 |
| RgbwColor | currentLedColor = LED_COLORS[currentLedColorId] |
| Config | config |
| AceButton buttonFour | ( | new | ButtonConfig() | ) |
| AceButton buttonOne | ( | new | ButtonConfig() | ) |
| AceButton buttonThree | ( | new | ButtonConfig() | ) |
| AceButton buttonTwo | ( | new | ButtonConfig() | ) |
| void configModeCallback | ( | WiFiManager * | myWiFiManager | ) |
| void handleButtonFourEvent | ( | AceButton * | button, |
| uint8_t | eventType, | ||
| uint8_t | buttonState | ||
| ) |
| void handleButtonOneEvent | ( | AceButton * | button, |
| uint8_t | eventType, | ||
| uint8_t | buttonState | ||
| ) |
| void handleButtonThreeEvent | ( | AceButton * | button, |
| uint8_t | eventType, | ||
| uint8_t | buttonState | ||
| ) |
| void handleButtonTwoEvent | ( | AceButton * | button, |
| uint8_t | eventType, | ||
| uint8_t | buttonState | ||
| ) |
| NeoPixelBusType pixelStrip | ( | PIXEL_COUNT | ) |
| void saveConfigCallback | ( | ) |
| void setButtonConfig | ( | ButtonConfig * | buttonConfig, |
| ButtonConfig::EventHandler | eventHandler | ||
| ) |
| void showTime | ( | ) |
| NeoTopology<MyPanelLayout> topo | ( | PANEL_WIDTH | , |
| PANEL_HEIGHT | |||
| ) |
| void updateClock | ( | ) |
| void updateLedColor | ( | ) |
| ClockModule clockModule(Wire, LOCAL_TIMEZONE, NTP_SERVER_NAME) |
| ConfigModule configModule(CONFIG_FILE_PATH) |
| RgbwColor currentLedColor = LED_COLORS[currentLedColorId] |
| LedControlModule ledControlModule(topo) |
| WifiModule wifiModule(DEVICE_NAME) |