Skip to content

Commit

Permalink
[testudo] Add average current
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Hall <hsw@openmoko.com>


git-svn-id: https://wikipediardware.googlecode.com/svn/trunk@1767 974c56cd-8151-0410-98c4-7bb2f43fa8c1
  • Loading branch information
hsw@openmoko.com committed Jun 23, 2009
1 parent 585d94b commit 0c94403
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion testudo/tests/test_SAMO_01.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,18 @@ def test002_on():
def test003_check_current():
"""Monitor current to see ok"""
global debug, psu, dvm, relay
for i in range(20):
averageCurrent = 0.0
samples = 20
for i in range(samples):
if debug:
psu.measure()
time.sleep(0.1)
i = psu.current
averageCurrent = averageCurrent + i
info('Supply current = %7.3f mA @ %5.1f V' % (1000 * i, psu.voltage))
fail_unless(abs(i) > MINIMUM_ON_CURRENT, "Device failed to power up")
fail_if(abs(i) > MAXIMUM_ON_CURRENT, "Device current too high")
info('Average supply current = %7.3f mA @ %5.1f V' % (1000 * averageCurrent / samples, psu.voltage))


def test004_measure_voltages():
Expand Down

0 comments on commit 0c94403

Please sign in to comment.