Running Demo Code
To run the demo code, perform the following on VisionFive 2 Debian:
-
Locate to the directory where the test code, I2C_Sense_Hat.py,
exists:
-
Under the sample-code directory, execute the following command to
run the demo code:
sudo python I2C_Sense_Hat.py
Alternatively, you can execute the following command:
sudo python3 I2C_Sense_Hat.py
Result:The temperature and the humidity data are displayed on the terminal:
[riscv@fedora-starfive sample-code]$ sudo python3 I2C_Sense_Hat.py i2c_dev: /dev/i2c-1 Temperature = 27.85°C , Humidity = 56.59 % Temperature = 27.83°C , Humidity = 56.60 % Temperature = 27.85°C , Humidity = 56.61 % Temperature = 27.86°C , Humidity = 56.60 % Temperature = 27.86°C , Humidity = 56.60 % Temperature = 27.80°C , Humidity = 56.60 % Temperature = 27.87°C , Humidity = 56.60 %