Skip to content

Commit

Permalink
hi-z on start, set current limit to 200mA reflecting shippable hardware
Browse files Browse the repository at this point in the history
  • Loading branch information
itdaniher authored and meeg committed Nov 20, 2011
1 parent bcdd93e commit 7ad9df2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ceeVendorReq.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ def clip(v, min, max):
class CEEChannel(object):
def __init__(self, cee, index, name, show):
self.cee = cee
cee.setA()
cee.setB()
self.i=0
self.v=0
self.voltageGain = 1
Expand All @@ -25,7 +27,7 @@ def __init__(self, cee, index, name, show):
stateOpts = ['source', 'measure']
self.voltageChan = pixelpulse.AnalogChannel('Voltage '+name, 'V', 0, 5, 'source',
stateOptions=stateOpts, showGraph=show, onSet=self.setVoltage)
self.currentChan = pixelpulse.AnalogChannel('Current '+name, 'mA', -400, 400, 'measure',
self.currentChan = pixelpulse.AnalogChannel('Current '+name, 'mA', -200, 200, 'measure',
stateOptions=stateOpts, showGraph=show, onSet=self.setCurrent)
self.gainChan = pixelpulse.AnalogChannel("Gain "+name, 'x', 1, 64, 'output', showGraph=False, onSet=self.setGain)
self.channels = [self.voltageChan, self.currentChan, self.gainChan]
Expand Down Expand Up @@ -55,7 +57,7 @@ def setCurrent(self, chan, ma, state=None):
if state is not None:
self.setDriving('i' if state=='source' else 'v')
if ma is not None:
self.i = clip(ma, -400, 400)
self.i = clip(ma, -200, 200)
self.cee.set(self.index, i=self.i/1000.0)

def getChanData(self, replypkt):
Expand Down

0 comments on commit 7ad9df2

Please sign in to comment.