Hello ![]()
First of all, English is not my mother language and I am also a complete beginner when it comes to programming, so please be kind!
I wanna control the LEDs on a X-NUCLEO-LED12A1 with a LOLIN D1 Mini via I2C.
I connected the boards together with 3.3V, GND and the SCL and SDA wires, then I used a I2C scanner to find the right addresses of the LED driver. Following Adresses were found:
0x 58, 0x59, 0x5A, 0x5B and 0x5C.
Now I just wanna see one of the LEDs light up, but I am a little bit lost on how to set the register via the Wire.write() command.
This is what I tried:
#include <Wire.h>
#define LED_ADRESS 0x5A
#define EN_REGISTER_ADRESS 0x01
const byte LED_AN = 0x01;
const byte LED_AUS = 0x02;
void setup() {
Wire.begin();
Serial.begin(9600);
}
void loop() {
Wire.beginTransmission(LED_ADRESS);
Wire.write(EN_REGISTER_ADRESS);
Wire.write(B100000); // Auf EN setzten
Wire.write(LED_AN);
delay(1000);
Wire.write(LED_AUS);
Wire.endTransmission();
delay(1000);
The code I came up with is probably completely wrong, but I simply doesn’t know which Registers I have to set.
I tried to use the following data sheets to learn about the LEDs, it seems that I have to enable the enable register first.
LED1202 - 12-Channel Low Quiescent Current LED Driver - STMicroelectronics
LOLIN D1 mini — WEMOS documentation
Thank you all in advise for your help ![]()
Vici