Once the environment is configured, you can test the routines. Several simple routines are provided on Jetson gpio, and we can test them briefly by entering them into the sample program directory first
cd /opt/nvidia/jetson-gpio/samples/
Wiring diagram:
1、simple_input.py
This is a simple input program that uses the BCM pin encoding mode and can read the value of PIN12 and print it to the terminal.
run a program:
sudo python3 simple_input.py
desired result:
After running the program, you can see the terminal printing information. By default, the value of Pin18 is low. Find a DuPont wire to connect pin 12 to 3.3V, and you can see that the read value has changed to HIGH. If connected to GND, it will display LOW
[Attention]