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 #327 months agoScore 0Permalink |Anonymous user #2011 months agoScore 0Permalink |Anonymous user #3013 months agoScore 0Permalink |Anonymous user #3113 months agoScore 0PermalinkAnonymous user #2916 months agoScore 0Permalink |Lisa16 months agoScore 0PermalinkAnonymous user #2819 months agoScore 0Permalink |Cindy19 months agoScore 0PermalinkAnonymous user #2819 months agoScore 0PermalinkAnonymous user #2720 months agoScore 0Permalink |Lisa20 months agoScore 0PermalinkAnonymous user #2623 months agoScore 0Permalink |Anonymous user #2523 months agoScore 0Permalink |Anonymous user #2523 months agoScore 0Permalink |Anonymous user #2327 months agoScore 0Permalink |Lisa27 months agoScore 0PermalinkAnonymous user #2427 months agoScore 0PermalinkAnonymous user #2227 months agoScore 0Permalink |Lisa27 months agoScore 0PermalinkAnonymous user #2028 months agoScore 0Permalink |Anonymous user #2028 months agoScore 0PermalinkAnonymous user #2028 months agoScore 0Permalink |Anonymous user #2128 months agoScore 0PermalinkAnonymous user #1928 months agoScore 0Permalink |Anonymous user #1829 months agoScore 0Permalink |Lisa28 months agoScore 0PermalinkAnonymous user #1729 months agoScore 0Permalink |Anonymous user #1629 months agoScore 0Permalink |Lisa29 months agoScore 0PermalinkAnonymous user #1530 months agoScore 0Permalink |Lisa30 months agoScore 0PermalinkAnonymous user #1431 months agoScore 0Permalink |Harry30 months agoScore 0PermalinkHarry30 months agoScore 0PermalinkAnonymous user #1132 months agoScore 0Permalink |Anonymous user #1231 months agoScore 0PermalinkAnonymous user #1132 months agoScore 0Permalink |Anonymous user #1033 months agoScore 0Permalink |Anonymous user #1331 months agoScore 0PermalinkAnonymous user #1331 months agoScore 0PermalinkAnonymous user #935 months agoScore 0Permalink |Lisa35 months agoScore 0PermalinkAnonymous user #935 months agoScore 0Permalink |Harry35 months agoScore 0PermalinkAnonymous user #835 months agoScore 0Permalink |Lisa35 months agoScore 0PermalinkAnonymous user #736 months agoScore 0Permalink |Lisa36 months agoScore 0PermalinkAnonymous user #637 months agoScore 0Permalink |Lisa36 months agoScore 0PermalinkAnonymous user #539 months agoScore 0Permalink |Lisa36 months agoScore 0PermalinkAnonymous user #442 months agoScore 0Permalink |Xiali42 months agoScore 0PermalinkAnonymous user #343 months agoScore 0Permalink |Anonymous user #343 months agoScore 0PermalinkXiali43 months agoScore 0PermalinkHarry44 months agoScore 0Permalink |Georgefeichter45 months agoScore 0Permalink |Georgefeichter46 months agoScore 0Permalink |Anonymous user #146 months agoScore 0Permalink |Anonymous user #246 months agoScore 0Permalink