feathercm package#

Submodules#

feathercm.base module#

feathercm.base.analogRead(pin, n=8)#

Reads an analog pin and adjusts the value according to a linear calibration. Allows rapid signal averaging and returns the value as 12-bit. Currently, errors seem to be on the order of +/- 5 mV.

feathercm.base.analogWrite(pin, value)#

Writes to an analog pin after correcting for calibration curve adjustments and switching value from 12 bit to 16 bit.

feathercm.base.analogWriteValue(x)#

Returns the ‘correct’ 12-bit integer value that generates the expected voltage for the input value. To perform this calibration, measure the actual voltage (with DVM) at A0 with respect to A0 setting. Best results are obtained for voltages under 2.0. Find the absolute error and convert that to an A0 adjustment value. Find the best fit line between A0 (x axis) and A0 adjustment value (y axis).

Note: the M4 cannot handle rail-to-rail and output is limited to 0.1 to 3.2

feathercm.base.analogWriteVoltage(pin, value, vground=True)#

Writes to an analog pin the requested voltage after correcting for calibration curve adjustments. Will correct for virtual ground if requested.

feathercm.base.commandValidQ()#

Checks if the latest command is valid

feathercm.base.init(featherwing)#

Starts feather-cm

feathercm.base.initFunc(*argv)#

Default initialization function

Featherwing module should override this function, although it doesn’t have to.

feathercm.base.listen()#

Starts listening to the serial line

If a command is present, read the line, check if it is a valid command, execute the command and return the response.

feathercm.base.rebootFunc(*argv)#

Reboots the instrument

feathercm.base.respond(response)#

Posts a response

feathercm.base.sba()#

Checks if a command is available on the serial line

feathercm.base.toVoltage(reading, vground=True)#

Convert a 12-bit reading into a voltage. Setting vground = False will return 0 to 3.3 V, a true value will return -1.65 to +1.65 V

feathercm.data module#

feathercm.data#

data class for FeAtHEr-Cm

class feathercm.data.data(*argv)#

Bases: object

Need to determine if these functions belong here or in base. Currently in both places

append(item)#

Appends item onto val

fromRaw(which, value)#

Converts a reading into a value

processData()#

Converts reading data into values

toCurrent(value)#

Convert raw value to a current

toInvertedVoltage(value)#

Convert raw value to a voltage

toReading(voltage)#
toSelf(value)#

Convert raw value into a time, possibly useful for prefix conversion

toVoltage(value)#

Convert raw value to a voltage

feathercm.echem module#

feathercm.echem#

This module contains functions and classes used in electrochemical measurements

class feathercm.echem.base(control, voltage, current)#

Bases: object

Base class for electrochemical measurements

controlOff()#
controlOn()#
scanrateCheck(scanrate)#
voltageCheck(voltage)#
feathercm.echem.getFunc(*argv)#
feathercm.echem.goFunc(*argv)#
feathercm.echem.initFunc(*argv)#
feathercm.echem.setFunc(*argv)#
class feathercm.echem.sweep(control, voltage, current)#

Bases: base

doSweep()#

Next gen CV sweep

getParameter(param)#
setParameter(param, value)#
setSamplingFrequency()#

Calculates the sampling frequency that results in 1024 points for the CV

feathercm.echem.testFunc(*argv)#

feathercm.settings module#

feathercm.settings.makeCommandDict(commands, functions)#

Create a dictionary from arguments

feathercm.settings.mergeDict(newDict)#

Merges the passed dictionary into the global dictionary. There is no checking of key overlap at present. Currently using this ‘feature’ to overload the base initialization command. Not sure if this is necessary.

feathercm.settings.setCurrentMultFunc(*argv)#
feathercm.settings.setDataSizeFunc(*argv)#

feathercm.spec module#

feathercm.spec.getFunc(*argv)#

Get current value for a parameter. Do not include a parameter for a list of possibilities.

feathercm.spec.initFunc(*argv)#
feathercm.spec.readFunc(*argv)#
feathercm.spec.setFunc(*argv)#

description

feathercm.spec.sourceFunc(*argv)#
feathercm.spec.timeSeriesFunc(*argv)#

Collects a time series of measurements.

feathercm.spec.toVoltage(value)#

Module contents#