Running Demo Codes
To run the demo code, perform the following on VisionFive 2 Debian:
-
To run the RPi demo on VisionFive 2, you need to replace the
import RPi.GPIO as GPIO
command withimport VisionFive.gpio as GPIO
in the RPi Python demo. - Locate to the directory where the test code, RPi_demo_#PWM#_run_on_VisionFive.py, exists:
- Under the sample-code directory, execute the following command to execute the demo code:
sudo python RPi_demo_#PWM#_run_on_VisionFive.py
Alternatively, you can execute the following command:
sudo python3 RPi_demo_#PWM#_run_on_VisionFive.py
Result:The LED blinks and the blink frequency will change according to the PWM frequency.