You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello folks, It moight appear silly but when I tried to use library with ESP32, my code doesn't compile. It throws error TLC59108.cpp:37:61: error: no matching function for call to 'TwoWire::TwoWire()'
TLC59108::TLC59108(const byte i2c_address): addr(i2c_address)
I was able to compile for Arduino Mega 2560 and it works fine. My project needs it to use ESP32. What should I do to get it working.
Here is my code:
#include "TLC59108.h"
Hello folks, It moight appear silly but when I tried to use library with ESP32, my code doesn't compile. It throws error TLC59108.cpp:37:61: error: no matching function for call to 'TwoWire::TwoWire()'
TLC59108::TLC59108(const byte i2c_address): addr(i2c_address)
I was able to compile for Arduino Mega 2560 and it works fine. My project needs it to use ESP32. What should I do to get it working.
Here is my code:
#include "TLC59108.h"
#define HW_RESET_PIN 19
#define I2C_ADDR 0x40 //TLC59108::I2C_ADDR::BASE
#define RED_PIN_ADDR 2
typedef struct clrName{
uint8_t red[3] ={0xFF,0x00,0x00};
uint8_t green[3] ={0x00,0xFF,0x00};
uint8_t blue[3] ={0x00,0x00,0xFF};
uint8_t cyan[3] ={0x00,0xFF,0xFF};
uint8_t orange[3] ={0xFF,0x99,0x00};
uint8_t yellow[3] ={0xFF,0xFF,0x00};
uint8_t pink[3] ={0xFF,0x14,0x93};
uint8_t magenta[3]={0xFF,0x00,0xFF};
uint8_t violet[3] ={0xEE,0x82,0xEE};
uint8_t purple[3] ={0x80,0x00,0x80};
uint8_t black[3] ={0x00,0x00,0x00};
uint8_t white[3] ={0xFF,0xFF,0xFF};
}colorNames_t;
TLC59108 leds(I2C_ADDR);
class rgbStrip{
public:
colorNames_t colorName;
public:
void init(void);
void setColor(uint8_t ledNo, uint8_t color[], uint8_t colorIntensity);
};
rgbStrip statusIndicator;
void setup() {
statusIndicator.init();
Serial.begin(9600);
}
void loop(){
sweep();
}
void sweep() {
byte pwm;
for(uint8_t i = 0; i < 100; i++){
statusIndicator.setColor(RED_PIN_ADDR, statusIndicator.colorName.cyan, i);
delay(10);
}
for(uint8_t i = 99; i < 0xFF; i--){
statusIndicator.setColor(RED_PIN_ADDR, statusIndicator.colorName.cyan, i);
delay(10);
}
for(uint8_t i = 0; i < 100; i++){
statusIndicator.setColor(RED_PIN_ADDR, statusIndicator.colorName.red, i);
delay(10);
}
for(uint8_t i = 99; i < 0xFF; i--){
statusIndicator.setColor(RED_PIN_ADDR, statusIndicator.colorName.red, i);
delay(10);
}
for(uint8_t i = 0; i < 100; i++){
statusIndicator.setColor(RED_PIN_ADDR, statusIndicator.colorName.green, i);
delay(10);
}
for(uint8_t i = 99; i < 0xFF; i--){
statusIndicator.setColor(RED_PIN_ADDR, statusIndicator.colorName.green, i);
delay(10);
}
}
/**
void rgbStrip :: init(void){
Wire.begin();
leds.init(HW_RESET_PIN);
leds.setLedOutputMode(TLC59108::LED_MODE::PWM_IND);
}
/**
void rgbStrip :: setColor(uint8_t ledNo, uint8_t color[], uint8_t colorIntensity){
uint8_t setColor[3];
float tempVal;
for (uint8_t i = 0; i < sizeof(setColor); i++){
tempVal = (color[i] * colorIntensity)/100;
setColor[i] = (uint8_t)tempVal;
}
leds.setBrightness(2, setColor[0]);
leds.setBrightness(3, setColor[0]);
leds.setBrightness(0, setColor[1]);
leds.setBrightness(1, setColor[1]);
leds.setBrightness(4, setColor[2]);
leds.setBrightness(5, setColor[2]);
delay(10);
}
Any help would be highly appreciated.
The text was updated successfully, but these errors were encountered: