feat: ajout start led on led lib (#5)

This commit is contained in:
2023-10-22 00:34:20 +02:00
parent 470abe2804
commit 92943ff3e9
4 changed files with 42 additions and 22 deletions

View File

@ -32,6 +32,13 @@ Program::Program() {
this->timeClient->update();
//this->sendTime("18h12");
// Startup Rotary
this->encoder = new SwitchableEncodeur(ENCODER_DT, ENCODER_CLK, ENCODER_SWITCH, 3);
// Startup LEDs
this->ledLib = new LedLib(PIXEL_COUNT, PIXEL_PIN, 255);
}
void Program::sendTime(String timeEnd){
@ -46,27 +53,27 @@ void Program::sendTime(String timeEnd){
void Program::loop() {
if(this->encoder->update()){
Serial.print(this->encoder->getValue());
this->ledLib->actLed(this->encoder->getValue());
this->ledLib->actLed(this->encoder->getValue(), 5);
Serial.print(" ");
Serial.println(this->encoder->getMenu());
}
delay(1000);
// delay(1000);
this->timeClient->update();
// this->timeClient->update();
int currentHour = this->timeClient->getHours();
Serial.print("Hour: ");
Serial.println(currentHour);
// int currentHour = this->timeClient->getHours();
// Serial.print("Hour: ");
// Serial.println(currentHour);
int currentMinute = this->timeClient->getMinutes();
Serial.print("Minutes: ");
Serial.println(currentMinute);
// int currentMinute = this->timeClient->getMinutes();
// Serial.print("Minutes: ");
// Serial.println(currentMinute);
int currentSecond = this->timeClient->getSeconds();
Serial.print("Seconds: ");
Serial.println(currentSecond);
// int currentSecond = this->timeClient->getSeconds();
// Serial.print("Seconds: ");
// Serial.println(currentSecond);
int currentDayOfWeek = this->timeClient->getDay();
Serial.print("Day of week: ");
Serial.println(currentDayOfWeek);
// int currentDayOfWeek = this->timeClient->getDay();
// Serial.print("Day of week: ");
// Serial.println(currentDayOfWeek);
}