Problems with setting the right Register for a LED Driver

Hello :slight_smile:
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.

X-NUCLEO-LED12A1 - LED driver expansion board based on LED1202 device for STM32 Nucleo - STMicroelectronics

LED1202 - 12-Channel Low Quiescent Current LED Driver - STMicroelectronics

LOLIN D1 mini — WEMOS documentation

Thank you all in advise for your help :slight_smile:
Vici

I did a quick look at the three links you provided. You should thoroughly study the LED1202 data sheet. My quick look revealed that address 5C is the global address to access the configuration registers of all 1202 devices. I would presume that the other 4 addresses are for each individual 1202 device. You just need to do the homework now.

The document for the driver board mentioned an example program for use by an ST controller. If you could find that source code you may learn some techniques for using the board.

I punched around on the ST website you linked and found this where you can download software written for their microcontrollers. I am on a tablet right now so I cannot open the zip file. The link is below:

Hopefully it is written in C so it will be somewhat translatable to Arduino C++. Between this and the data sheet you will need to figure it out for yourself. Not being rude, it’s just the way it is. I don’t have your hardware so I cannot do much more.

Some links are in this PDF..
https://www.st.com/resource/en/product_presentation/x-nucleo-led12a1_quick_start_guide.pdf