Open main menu

Changes

X728-script

124 bytes added, 00:37, 23 July 2023
Each example program demonstrates a different function:
'''read_fan_speedx728-v2.x-bat.py''': Read the pwm fan running speedScript to read battery power and voltage;
cd ~x728-script
sudo python3 sample/read_fan_speedx728-v2.x-pld.py
'''x728-v2.x-pld.py''': Script to AC Power supply loss dection script;
cd ~x728-script
sudo python3 sample/x728-v2.x-pld.py.py
'''plsdx728-v2.x-asd.py''': Script to Auto shutdown when AC power loss or power adapter failure script;(Added auto shuntdown function base pld.py)the battery voltage is lower than a certain specified value
cd ~x728-script
sudo python3 sample/plsdx728-v2.x-asd.pyPS:
'''buzzer1.py''': demonstrates how the buzzer will sound when power supply is lost, which is very important in some usage scenarios. cd ~x728-script sudo python3 sample/buzzer.py The above sample python file maybe depends on the third-party python library `Rpi.GPIO`. In the official Raspberry Pi OS and most third-party OS, this library is installed by default. If you run this file and get some errors, try to run the following command to install the Rpi.GPIOy library.
sudo apt-get install -y python3-smbus python3-rpi.gpio
Or you can refer to [[How to Install RPi.GPIO Python Library]]
 
2. The sample file based on the version number is just because different versions of X728 use different GPIOs, they are basically the same. You can use a file comparison tool to view it, if you get it wrong, most likely you are using the wrong version of the sample file.
===Enable OLED display===