Running Demo Codes
To run the demo code, perform the following on VisionFive 2 Debian:
- Locate to the directory where the test code, pud_test.py, exists:
- Under the sample-code directory, execute the following command to execute the demo code:
sudo python pud_test.py
Alternatively, you can execute the following command:
sudo python3 pud_test.py
Result:The terminal displays as follows:
# python3 pud_test.py *----------------------Start testing------------------------------* Step 1: set input to direction of GPIO pin 31. Step 2: the default input level is HIGH. Step 3.1: set PUD_DOWN to input direction of GPIO pin 31. Step 3.2: the input level with pull_down enabled is LOW. Step 4.1: set PUD_UP to input direction of GPIO pin 31. Step 4.2: the input level with pull_up enabled is HIGH. *---------------------------end test------------------------------*