-

How to use UPS HAT via driver: Difference between revisions

From Geekworm Wiki
Jump to navigation Jump to search
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 11: Line 11:


* Install wiringPi
* Install wiringPi
  git clone git://git.drogon.net/wiringPi
  git clone https://github.com/WiringPi/WiringPi
cd wiringPi
git pull origin
  cd wiringPi
  cd wiringPi
  ./build
  ./build


* Download the zip package;([[File:Rpi-ups-hat-20190621.zip]] [[File:Rpi-ups-hat.zip]])
* Download the zip package;([[File:Rpi-ups-hat-20190621.zip]] [[File:Rpi-ups-hat.zip]])
# wget http://www.raspberrypiwiki.com/download/ups-hat/rpi-ups-hat.zip
  unzip Rpi-ups-hat.zip
  unzip Rpi-ups-hat.zip
  cd rpi-ups-hat
  cd rpi-ups-hat
Line 24: Line 21:
* Run the sample program
* Run the sample program
  sudo python example.py
  sudo python example.py
[[Category:Knowledge]]

Latest revision as of 19:25, 30 April 2026

How to use UPS HAT via driver

  • Upgrade software:
sudo apt-get update 
sudo apt-get upgrade
  • Enable the I2C function via raspi-config tool.

via raspi-config tool...

  • install python-smbus
$sudo apt-get install python-smbus
  • Install wiringPi
git clone https://github.com/WiringPi/WiringPi
cd wiringPi
./build
unzip Rpi-ups-hat.zip
cd rpi-ups-hat
  • Run the sample program
sudo python example.py