Welcome to JetCobot repository
5. Control LED
Control LED
Use the example led.py
Control LED flashing based on JETSON NANO's GPIO
Hardware connection Connect the positive pole of LED to the 12th pin of JETSON NANO, and the negative pole to the 39th pin (GND). Control the LED on and off by controlling the pin output high and low levels, and control the interval time by the .sleep() method in the time library.
Run the program
xxxxxxxxxxcd /opt/nvidia/jetson-gpio/samples/sudo python3 led.py
Expected effect After connecting the hardware, run the program, and the LED will flash once every 2 seconds. (The RGB lamp used in the experiment is the RGB lamp module in our store. You can buy it if you want to test it yourself)
Note: If you want to use other LED modules, it is best to connect a protective resistor of appropriate size between the LED and the pin as protection, otherwise the overcurrent may burn out the JETSON NANO.
