Basic LED Example with Jetson AGX Orin

Hello, I was wondering if anyone knows a good resource to start my first led blink example with the jetson orin. Currently, I am using this code but it does not seem to be working with the defined pins. I am also using Jetpack 6. Any guidance would be greatly appreciated!

# GPIO library

import Jetson.GPIO as GPIO

# Handles time

import time

# Pin Definition

led_pin = 7

# Set up the GPIO channel

GPIO.setmode(GPIO.BOARD)

GPIO.setup(led_pin, GPIO.OUT, initial = GPIO.HIGH)

print ( "Press CTRL+C when you want the LED to stop blinking" )

# Blink the LED

while True :

time.sleep( 2 )

GPIO.output(led_pin, GPIO.HIGH)

print ( "LED is ON" )

time.sleep( 2 )

GPIO.output(led_pin, GPIO.LOW)

print ( "LED is OFF" )

Hi cbso,

Are you using the devkit or custom board for AGX Orin?

Are you using Jetpack 6 DP(r36.2) or Jetpack 6 GA(R36.3)?
Please share the result of the following command on your board.

$ cat /etc/nv_tegra_release

Which pin would you like to use to connect with LED?

Hi. When I do the command you suggested, I get this output:

R36 (release), REVISION: 3.0, GCID: 36191598, BOARD: generic, EABI: aarch64, DATE: Mon May 6 17:34:21 UTC 2024

KERNEL_VARIANT: oot

TARGET_USERSPACE_LIB_DIR=nvidia

TARGET_USERSPACE_LIB_DIR_PATH=usr/lib/aarch64-linux-gnu/nvidia

I believe this is Jetpack 6 GA(R36.3). Additionally, my led is connected to physical pin 7.

Do you mean the PIN7 of 40-pin header as following?

If so, this pin is configured as Input/PD in pinmux spreadsheet by default.

Please configure it as Output/Drive 0 instead

After applying the change for pinmux, please run the following commands to control it HIGH.

$ sudo su
# gpioset --mode=wait `gpiofind "PQ.06"`=1 

There’s another thread discussing about this, you can also refer to it.
Issue with GPIO on Jetson Orin Nano with Jetpack 6 - #9 by KevinFFF

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.