In [2]:
!pip3 install --user git+https://bitbucket.org/subinitial/subinitial.git
This is an example script showcasing all the functionality of the source meter.
The source meter provides a constant positive voltage. To use, connect the Stacks to the analog deck, then connect your device to the source meter pin(pin 1), and the ground pin next to it. Then, connect your computer to the Stacks via the Ethernet cable.
Make sure your device can handle two volts before running this.
In [3]:
import subinitial.stacks as stacks
core = stacks.Core(host="192.168.1.49") # Default host IP
analogdeck = stacks.AnalogDeck(core, bus_address=2) # Default Analog Deck bus address
""" BASIC USAGE """
analogdeck.sourcemeter.set_sourcevoltage(2) # Set the sourcemeter output voltage
#Demo sourcemeter internal measurements
print("This should show 2V: {0}".format(analogdeck.sourcemeter.get_sourcevoltage()))
print("Show the measured telemetry:")
print("Voltage (V): {0}".format(analogdeck.sourcemeter.get_metervoltage()))
print("Current (A): {0}".format(analogdeck.sourcemeter.get_metercurrent()))
print("Show the measured power:")
print("Power(W): {0}".format(analogdeck.sourcemeter.get_meterpower()));