protolab

 

WiTiltBatteryTestScript

Page history last edited by bjoern 2 yrs ago

Leith's Python test code for these measurements (requires pySerial and win32 extensions on Windows):

import serial

import time

 

print "begin WiTiltStressTest"

 

ser = serial.Serial(15, 57600, timeout=5, parity="N", bytesize=8)

curTime = time.time()

nowTime = time.time()

 

print "++++++++++++++++++++++++++++++++++++++"

print "opened Bluetooth COMPort"

print "please reset WiTilt to change modes"

print "++++++++++++++++++++++++++++++++++++++"

 

for i in range(13):

print ser.readline()

 

ser.write("1")

 

print "++++++++++++++++++++++++++++++++++++++"

print "turning on WiTilt Readings"

print "++++++++++++++++++++++++++++++++++++++"

 

line = ser.readline()

 

while len(line):

#print line

line = ser.readline()

ser.flushInput()

 

nowTime = time.time()

ser.close()

 

print "++++++++++++++++++++++++++++++++++++++"

print "battery has lasted " + str(round(nowTime - curTime - 5, 3)) + " seconds"

 

Comments (0)

You don't have permission to comment on this page.