Welcome to Muto S2 Robot repository
8.Control LED
Control LED
LED. py using routines
GPIO control LED flashing based on Jetson Nano
Hardware connection:
Connect the positive pole of the LED to the 12th pin of the Jetson Nano and the negative pole to the 39th pin (GND). By controlling the high and low levels of the pin output, the LED is controlled to turn on and off. The interval time is controlled using the. sleep () method in the time library.
run a program:
sudo python3 led.py
desired result:
After connecting the hardware and running the program, the LED light will flash every 2 seconds. (Change the experimental rgb light to our store's rgb light module, if you want to test it yourself, you can choose to purchase it)
Note: If using other LED modules, it is best to connect an appropriately sized protective resistor between the LED and the pins as protection, otherwise overcurrent may burn out the Jetson Nano.
