Welcome to Muto S2 Robot repository
6.Pin reading function
Pin reading function
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 program:
sudo python3 simple_input.py
Expected effect:
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:
- 18 here refers to the BCM code, while PIN12 above refers to the physical code, which is the code of the screen printed on the board.
- The working level of the Jetson nano pin is 3.3V, so try not to connect it to a 5V level when using it.