-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot use RGB values with RGB encoders #5
Comments
Hello, |
The code is part of the Rust driver I'm writing (mentioned in #4), it is far from complete so it's a bit problematic for me to post it in a usable form at the moment. Hardware I'm using at the moment is a Nucleo32-F042K6 with I2CEncoderV2. A sequence that I'm using which fails is (I'm currently looking at a full on blue):
I also tried reducing the I2C frequency down to 10kHz but no change. |
I have tried this sequence: Encoder.begin(INT_DATA | WRAP_ENABLE | DIRE_LEFT | IPUP_ENABLE | RMOD_X1 | RGB_ENCODER); And i get the LED white, that is correct. |
Uhm, too fast? The weird thing is that the values read back perfectly fine so they're registered by the MCU, just not properly applied. |
Try to add a delay between the commands and tell me if it's solve.
|
I can't. This is a generic driver, could be executed on anything from a small MCU over a RaspPi over to a Windows server connected via a FTDI chip. I can only use defined features of the I2C bus which is write and write followed by a read.
That makes it even worse. Reminds me, this should also be mentioned in the documentation; I wasn't sure if the registers are auto-incrementing since it worked even worse than before when I tried. But I figured out a way to make it work: Reduce the I2C clock to 10kHz and write some dummy value (e.g. 0, 0, 0) to the RGB LED registers first... Something is really off here... |
Hi,
In my test, the RGB LED correctly turns on with white color, i did't have any issue. I don't know what was happening to you, did you tried with a different board? |
Here's some screenshots from my transaction, I removed most of the hacks (forgot I had an additional enable RGB led in my test application, sorry) I had in there and slowed down the I2C frequency to 10kHz. After writing FF FF FF, you can see that I'm reading back the values successfully yet all three LEDs stayed off:
Not yet. But this is one of my goto MCU, I'm using it for everything, especially I2C driver development. If it doesn't work on this MCU then I cannot release the driver... |
Any update? |
First I'm enabling the RGB LED by setting the ETYPE bit and then I'm calling a function which tries to do a write on
RLED
, thenGLED
thenBLED
in succession but depending on the combination of colours and the previous value this yields completely random results; single colours mostly work, combinations of RGB deliver completely random results.Reading back the
RLED
,GLED
andBLED
registers shows the correct colours I've set before. Fading is disabled.The text was updated successfully, but these errors were encountered: