Folgende Warnungen sind aufgetreten:
Warning [2] Undefined variable $unreadreports - Line: 34 - File: global.php(961) : eval()'d code PHP 8.2.24 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/global.php(961) : eval()'d code 34 errorHandler->error_callback
/global.php 961 eval
/showthread.php 28 require_once
Warning [2] Undefined property: MyLanguage::$thread_modes - Line: 43 - File: showthread.php(1621) : eval()'d code PHP 8.2.24 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1621) : eval()'d code 43 errorHandler->error_callback
/showthread.php 1621 eval




Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
USV PIco Status Anzeige.
#3
Hi Christian wie gewünscht:

#!/usr/bin/python
# -*- coding: utf-8 -*-
# improved and completed by PiModules Version 1.0 29.08.2015
# picoStatus-v3.py by KTB is based on upisStatus.py by Kyriakos Naziris
# Kyriakos Naziris / University of Portsmouth / kyriakos@naziris.co.uk


import smbus
import time
import datetime

# You can install psutil using: sudo pip install psutil
#import psutil

i2c = smbus.SMBus(1)

def pwr_mode():
data = i2c.read_byte_data(0x69, 0x00)
data = data & ~(1 << 7)
if (data == 1):
return "RPi"
elif (data == 2):
return "BAT"
else:
return "ERR"

def bat_level():
time.sleep(0.1)
data = i2c.read_word_data(0x69, 0x01)
data = format(data,"02x")
return (float(data) / 100)

def rpi_level():
time.sleep(0.1)
data = i2c.read_word_data(0x69, 0x03)
data = format(data,"02x")
return (float(data) / 100)

def fw_version():
time.sleep(0.1)
data = i2c.read_byte_data(0x6b, 0x00)
data = format(data,"02x")
return data

def sot23_temp():
time.sleep(0.1)
data = i2c.read_byte_data(0x69, 0x0C)
data = format(data,"02x")
return data

def to92_temp():
time.sleep(0.1)
data = i2c.read_byte_data(0x69, 0x0d)
data = format(data,"02x")
return data

def ad1_read():
time.sleep(0.1)
data = i2c.read_word_data(0x69, 0x05)
data = format(data,"02x")
return (float(data) / 100)

def ad2_read():
time.sleep(0.1)
data = i2c.read_word_data(0x69, 0x07)
data = format(data,"02x")
return (float(data) / 100)

print " "
print " pico status V1.0"
print "***********************************"
print " ","UPS PIco Firmware:",fw_version()
print " ","Powering Mode:",pwr_mode()
print " ","BAT Volatge:", bat_level(),"V"
print " ","RPi Voltage:" , rpi_level(),"V"
print " ","SOT23 Temperature:" , sot23_temp(),"C"
print " ","TO-92 Temperature:" , to92_temp(),"C"
print " ","A/D1 Voltage:" , ad1_read(),"V"
print " ","A/D2 Voltage:" , ad2_read(),"V"
print "***********************************"
print " "
Raspberry Pi 2 , Pollin 7" Display, PIco USV, Jessie Image
Am Testen Raspberry Pi 3, 7" Orginal Display, Jessie Image
Zitieren


Nachrichten in diesem Thema
USV PIco Status Anzeige. - von Skorpionbird - 11.05.2016, 10:37
RE: USV PIco Status Anzeige. - von cbrauweiler - 11.05.2016, 12:48
RE: USV PIco Status Anzeige. - von Skorpionbird - 11.05.2016, 19:19
RE: USV PIco Status Anzeige. - von harryberlin - 11.05.2016, 20:50
RE: USV PIco Status Anzeige. - von Skorpionbird - 12.05.2016, 10:06
RE: USV PIco Status Anzeige. - von harryberlin - 12.05.2016, 11:25
RE: USV PIco Status Anzeige. - von Skorpionbird - 12.05.2016, 11:26
RE: USV PIco Status Anzeige. - von Skorpionbird - 17.05.2016, 11:41
RE: USV PIco Status Anzeige. - von cbrauweiler - 17.05.2016, 12:37
RE: USV PIco Status Anzeige. - von harryberlin - 18.05.2016, 21:18
RE: USV PIco Status Anzeige. - von Skorpionbird - 19.05.2016, 08:29
RE: USV PIco Status Anzeige. - von harryberlin - 19.05.2016, 11:47

Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 2 Gast/Gäste
RasPiCarProjekt