I2C PWM expander added from different Project

This commit is contained in:
2024-11-16 16:42:29 +01:00
parent deccb3186c
commit f6608075ff
7 changed files with 327 additions and 0 deletions
+22
View File
@@ -26,7 +26,9 @@
#include "ethernet_init.h"
#include "esp_netif.h"
#include "esp_eth.h"
// Component header
#include "Task.hpp"
#include "PwmExpanderPca9685.hpp"
static const char *TAG = "Watch";
static esp_eth_handle_t s_eth_handle = NULL;
@@ -111,8 +113,28 @@ static void initialize_ethernet(void)
void LightingTask() {
ESP_LOGI(TAG, "Start Lighting");
static I2cMaster master(I2C_NUM_0,
/*sda=*/ GPIO_NUM_13,
/*scl=*/ GPIO_NUM_16);
// static PmwExpanderPca9685 pca9685(master);
static PmwExpanderPca9685 ledDriver1(master, /*iverted=*/ true);
static PmwExpanderPca9685 ledDriver2(master, /*iverted=*/ true, 0x41);
PmwExpanderPca9685::GrayValues values[2];
while (true) {
ESP_LOGI("Light", "Tick");
values[0].fill(0);
values[1].fill(0);
values[0][12] = 0x100;
values[0][15] = 0x100;
ledDriver1.sendImage(values[0]);
values[1][1] = 0x100;
values[1][2] = 0x100;
ledDriver2.sendImage(values[1]);
fos::Task::delayMs(1000);
}
}