X708-Software
The following test is base on '2020-02-13-raspbian-buster.img'
Python version: V2.7
1. Enable I2C funcion on Raspbian:
sudo raspi-config
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 "OK"
Select "Finish" to return to the command line and reboot your raspberry pi.
sudo reboot
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
x708off
8. Testing AC power off/loss or power adapter failure detection (need to shor the 'PLD' pin)
sudo python x708pld.py
9. How to programming to get ASD function on V1.2 version
The following is fake C/C++ code:
while(1) { // You need to implement getCurrentVoltage function float fVoltage = getCurrentVoltage(); if (fVoltage <= 2.5) { //execute shut down command, "sudo x708off" break; } }Return to X708Enable comment auto-refresherAnonymous user #326 months agoScore 0Permalink |Anonymous user #2010 months agoScore 0Permalink |Anonymous user #3012 months agoScore 0Permalink |Anonymous user #3111 months agoScore 0PermalinkAnonymous user #2915 months agoScore 0Permalink |Lisa15 months agoScore 0PermalinkAnonymous user #2818 months agoScore 0Permalink |Cindy18 months agoScore 0PermalinkAnonymous user #2818 months agoScore 0PermalinkAnonymous user #2718 months agoScore 0Permalink |Lisa18 months agoScore 0PermalinkAnonymous user #2621 months agoScore 0Permalink |Anonymous user #2522 months agoScore 0Permalink |Anonymous user #2522 months agoScore 0Permalink |Anonymous user #2325 months agoScore 0Permalink |Lisa25 months agoScore 0PermalinkAnonymous user #2425 months agoScore 0PermalinkAnonymous user #2225 months agoScore 0Permalink |Lisa25 months agoScore 0PermalinkAnonymous user #2026 months agoScore 0Permalink |Anonymous user #2026 months agoScore 0PermalinkAnonymous user #2026 months agoScore 0Permalink |Anonymous user #2126 months agoScore 0PermalinkAnonymous user #1927 months agoScore 0Permalink |Anonymous user #1827 months agoScore 0Permalink |Lisa26 months agoScore 0PermalinkAnonymous user #1727 months agoScore 0Permalink |Anonymous user #1627 months agoScore 0Permalink |Lisa27 months agoScore 0PermalinkAnonymous user #1529 months agoScore 0Permalink |Lisa29 months agoScore 0PermalinkAnonymous user #1429 months agoScore 0Permalink |Harry29 months agoScore 0PermalinkHarry29 months agoScore 0PermalinkAnonymous user #1131 months agoScore 0Permalink |Anonymous user #1229 months agoScore 0PermalinkAnonymous user #1131 months agoScore 0Permalink |Anonymous user #1031 months agoScore 0Permalink |Anonymous user #1329 months agoScore 0PermalinkAnonymous user #1329 months agoScore 0PermalinkAnonymous user #933 months agoScore 0Permalink |Lisa33 months agoScore 0PermalinkAnonymous user #933 months agoScore 0Permalink |Harry33 months agoScore 0PermalinkAnonymous user #833 months agoScore 0Permalink |Lisa33 months agoScore 0PermalinkAnonymous user #734 months agoScore 0Permalink |Lisa34 months agoScore 0PermalinkAnonymous user #635 months agoScore 0Permalink |Lisa34 months agoScore 0PermalinkAnonymous user #538 months agoScore 0Permalink |Lisa34 months agoScore 0PermalinkAnonymous user #441 months agoScore 0Permalink |Xiali41 months agoScore 0PermalinkAnonymous user #342 months agoScore 0Permalink |Anonymous user #342 months agoScore 0PermalinkXiali42 months agoScore 0PermalinkHarry42 months agoScore 0Permalink |Georgefeichter44 months agoScore 0Permalink |Georgefeichter44 months agoScore 0Permalink |Anonymous user #144 months agoScore 0Permalink |Anonymous user #244 months agoScore 0Permalink