Clement 58516e5f7c feat: V1 fonctionnel OK (#8)
Reviewed-on: #8
Co-authored-by: Clement <c.boesmier@aptatio.com>
Co-committed-by: Clement <c.boesmier@aptatio.com>
2023-12-03 12:24:37 +01:00

70 lines
1.0 KiB
C++

#ifndef PROGRAM_H
#define PROGRAM_H
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <NTPClient.h>
#include <WiFiUdp.h>
#include "DiscordAPI.h"
#include "SwitchableEncodeur.h"
#include "LedLib.h"
enum MainMenu{
INITIAL_STATE,
GET_START_HOUR,
SELECT_END_HOUR,
SEND_TO_DISCORD
};
class Program {
public:
/**
* Program startup
*/
Program();
/**
* Program main loop
*/
void loop();
private:
/**
* Encoder object
*/
SwitchableEncodeur* encoder;
/**
* Old encoder position
*/
long oldPosition;
DiscordAPI* discord;
LedLib* ledLib;
WiFiUDP* ntpUDP;
NTPClient* timeClient;
/**
* @brief Send time to discord
* the start time is automaticly set to the current time
* @param[in] timeEnd LabOuest closing time
*/
void sendTime(String timeEnd);
//state of the button
MainMenu menu;
//temps de reset in ms
ulong resetMillis;
//numéro de led de dépard
int nLedStart;
// apres midi
bool pm;
};
#endif