The following test is base on '2020-02-13-raspbian-buster.img'
Python version: V2.7
1. Enable I2C funcion on Raspbian:
Select 5 Interfacing Options and then P5 I2C - Enable/Disable automatic loading. A prompt will appear asking Would you like the ARM I2C interface to be enabled?, select "Yes"
Select "Finish" to return to the command line and reboot your raspberry pi.
2. Install necessary software (python and i2c tool library)
sudo apt-get install python-smbus sudo apt-get install i2c-tools
3. Download x708 setup scripts:
git clone https://github.com/geekworm-com/x708.git cd x708 chmod +x x708.sh
4. Install script&reboot:
sudo bash x708.sh printf "%s\n" "alias x708off='sudo x708softsd.sh'" >> ~/.bashrc sudo reboot
6. How to reading battery voltage and percentage, this is the sample code, you can modify it by your request.
sudo python x708bat.py
7. How to power off command on Raspbian from software
8. Testing AC power off/loss or power adapter failure detection (need to shor the 'PLD' pin)
sudo python x708pld.py
Return to X708