How to Turn On/Off LED using GPIO Pin in Axon?

To configure you need root permission.
Run su command in teminal and enter root password.
Vicharak Board Root password is root

  1. Here, you can find SOC GPIOs Header pins for Axon RK3588 Processor.
    Axon GPIO Header

  2. The GPIOs are typically accessible in /sys/class/gpio folder.
    Each GPIO Pins have folder named as gpio<GPIO_NUMBER>.
    Example : GPIO PIN 13 on header => gpio16 for GPIO0_C0

    You need root permission to configure it. Make sure you’re in root User.
    by running command sudo su then, enter the root password OR you can run below commands using sudo.

    If the folder is not present, the GPIO needs to be exported first.

    echo 16 > /sys/class/gpio/export

  3. To configure the pin for LED Blink, set the GPIO number 16 as an output

    echo out > /sys/class/gpio/gpio16/direction

  4. Read the value by

    cat /sys/class/gpio/gpio16/value

  • To set GPIO0_C0 as low

    echo 0 > /sys/class/gpio/gpio16/value

  • To set GPIO0_C0 as high

    echo 1 > /sys/class/gpio/gpio16/value

Note:

  • you can set GPIO as an input

    echo in > /sys/class/gpio/gpio16/direction

  • you can also unexport it -

    echo 16 > /sys/class/gpio/unexport