Lionel Leyko 0 Posted April 24, 2021 Hello, How I can use a 3x programmable led's onboard? I don't find info about this. Can you show me an example code in Python? Alternative, which number of GPIO they have? Thank you LL Share this post Link to post Share on other sites
tooz 53 Posted April 26, 2021 hello @Lionel Leyko could you link us the 3x programmable led's you're using? Share this post Link to post Share on other sites
Lionel Leyko 0 Posted April 29, 2021 I do not understand what you mean. I am posting the original schematic with 3x programmable LEDs on the left, next to the cooler. I would like to use them in a project, but I don't know how to control them. I am interested in using them in the Python environment. Share this post Link to post Share on other sites
tooz 53 Posted April 30, 2021 hello @Lionel Leyko, gotcha. the 3 LEDs have been registered with LED GPIO subsystem. here are the commands to control the LEDs: sudo su echo 1 > /sys/class/leds/led1/brightness echo 0 > /sys/class/leds/led1/brightness echo 1 > /sys/class/leds/led2/brightness echo 0 > /sys/class/leds/led2/brightness echo 1 > /sys/class/leds/led3/brightness echo 0 > /sys/class/leds/led3/brightness Share this post Link to post Share on other sites
Tzuhsuan 0 Posted May 3, 2021 We use the gpio-leds module to control the led and keep them not light as default. In fsl-imx8mq-phanbell.dts: gpio-leds { compatible = "gpio-leds"; led1 { gpios = <&gpio3 21 GPIO_ACTIVE_HIGH>; linux,default-trigger="none"; }; led2 { gpios = <&gpio4 29 GPIO_ACTIVE_HIGH>; linux,default-trigger="none"; }; led3 { gpios = <&gpio4 28 GPIO_ACTIVE_HIGH>; linux,default-trigger="none"; }; }; (led gpio is low active) Because the gpios have been registered by gpio leds module, you cannot use gpio library to register them again. Please control them by the nodes in /sys/class/leds/. Share this post Link to post Share on other sites