mirror of
https://github.com/brmlab/edubrm.git
synced 2025-06-09 13:24:00 +02:00
fixes
This commit is contained in:
parent
e952f51d32
commit
178077c0bd
1 changed files with 8 additions and 4 deletions
|
@ -28,11 +28,15 @@ class ModuleBWidget(QWidget):
|
||||||
|
|
||||||
def read_inputs(self):
|
def read_inputs(self):
|
||||||
r = self.dev.read()
|
r = self.dev.read()
|
||||||
us = r[1]/1023.0 * 3.3 - 0.091
|
us = r[1]/1023.0 * 3.3 - 0.095
|
||||||
if us < 0:
|
if us < 0.0:
|
||||||
us = 0
|
us = 0.0
|
||||||
uc = r[2]/1023.0 * 3.3
|
uc = r[2]/1023.0 * 3.3 - 0.04
|
||||||
|
if uc < 0.0:
|
||||||
|
uc = 0.0
|
||||||
i = (us-uc)/18*1000
|
i = (us-uc)/18*1000
|
||||||
|
if i < 0.0:
|
||||||
|
i = 0.0
|
||||||
self.ui.labelUs.setText('Us = %0.3f V' % us)
|
self.ui.labelUs.setText('Us = %0.3f V' % us)
|
||||||
self.ui.labelUc.setText('Uc = %0.3f V' % uc)
|
self.ui.labelUc.setText('Uc = %0.3f V' % uc)
|
||||||
self.ui.labelI.setText('I = %0.2f mA' % i)
|
self.ui.labelI.setText('I = %0.2f mA' % i)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue