Welcome to JetCobot repository
3.Pin reading function
Pin reading function
After the environment is configured, you can test the routine. There are several simple routines provided on jetson-gpio that we can test simply. First enter the sample program directory
xxxxxxxxxxcd /opt/nvidia/jetson-gpio/samples/
Wiring diagram:

- simple_input.py
This is a simple input program that uses the BCM pin encoding mode. It can read the value of PIN12 and print it to the terminal.
Run the program:
xxxxxxxxxxsudo python3 simple_input.py
Expected results:
After running the program, you can see the terminal print information. By default, the value of Pin18 is low. Find a Dupont line to connect pin 12 to 3.3V. You can see that the read value becomes HIGH. If it is connected to GND, it will display LOW

【Note】
- Here 18 refers to the BCM code, and the PIN12 above refers to the physical code, which is the code printed on the board.
- The working level of the JETSON NANO pin is 3.3V, so try not to connect it to 5V level when using it.