Issue details
Toshiba LED doesnt work from firmware AC3.52
at version AC 3.4.6 I have had the Toshiba LED working.
monitoring the I2C output using arduino I see that the commands printed are:
0x8381 : 0
0x8182 : 1
0x8283 : 1
0x8381 : 0
0x8182 : 0
0x8283 : 0
0x8381 : 0
0x8182 : 1
On the newer versions from AC3.5.2 I have only printed out those commands:
0:0
0:1
1:1
What did you change and how can I get it to work?
I use Arduino to take the values and convert them to WS2812.
To clarify: the external LED works. Your arduino code doesn’t.
Your code needs to be compatible with the current driver in the AP_Notify library, which replaced the old one from the px4 HAL.
Thanks for your answer, unfortunately yes it is been asked but after searching for about a week in almost every forum I didnt find the information.
In AP_Notify there are many files, looking at new ToshibaLED_I2C.cpp / ToshibaLED_I2C.h I didnt find what can cause the messages that go out at 0x55 to be shown as 0/1 so I asked here more detailed info what should I look for…
I will appreciate your help.
I don’t get it. The ToshibaLED driver is looking for a device with three LED’s that respond on address 0x55. If your device does not respond to the commands then it’s will ignore you.
The first thing the code does is send an enable to register 3 of the device to enable it. If you don’t respond the driver shuts down.
After that it sends PWM values to the three LED’s do indicate values not 1 or 0.
I drive WS2812 with my unit and I use Telem2 port and decode Mavlink messages so I can do more than just flash the LED’s. I can determine pitch and roll as well as flight modes.
After some investigation I have a few remarks / questions.
The first thing the code does is send an enable to register 3 of the device to enable it. If you don’t respond the driver shuts down. proven to be NOT TRUE!, I will explain why.
When the Pixracer load it sends 0x04 & 0x03, it is only to set the registers on the Toshiba chip but it doesnt wait or ask for response and does not disable the functuion when it does not get any response.
I added a handler in Arduino to check if the controller ask for response by using Wire.onRequest(requestEvent);
}
and no there is not any request event!
2. More than that the controller continue to send 4 byte values even if there is no response from Arduino…
I guess the reason that I dont see anymore the 0x81/0x82/0x83 is because you are now working at with auto-increment method (0x01).
So the first bit is 0x01 and than the second bit is for red, third bit is for green and 4th bit is for blue. - values of 0 or 1. (0 = off 1 =on)
under Modules/PX4Firmware/src/drivers/rgbled.cpp at line 391 I think it has a mistake.
if (ret == OK) {
on = result[0] & SETTING_ENABLE;
powersave = !(result[0] & SETTING_NOT_POWERSAVE );
From looking at the TCA62724FMG PDF I think it should be:
on = result[0] & ( SETTING_ENABLE << 4 );
powersave = !(result[0] & ( SETTING_NOT_POWERSAVE << 4 ) );
Since the SHDN is at bit-4 and ENABLE is at bit-5.
I was able to “translate” the Toshiba LED data from the I2C bus. What I don’t like about Mavpixel is it’s reliance on code to translate the Mavlink and decide in lighting. By using the LED data off the I2C bus, the Pix is making the color decisions.
they say that they managed to get far more strict timings for Dshot . why they dont do it for the led .
i can undestand that its not neccecety for flight functionalyty but the pixhawk has a lot of computation power …