In [2]:
!pip3 install --user git+https://bitbucket.org/subinitial/subinitial.git


Collecting git+https://bitbucket.org/subinitial/subinitial.git
  Cloning https://bitbucket.org/subinitial/subinitial.git to c:\users\patrick\appdata\local\temp\pip-03uzvla4-build
Installing collected packages: subinitial.stacks
  Found existing installation: subinitial.stacks 1.13.0
    Uninstalling subinitial.stacks-1.13.0:
      Successfully uninstalled subinitial.stacks-1.13.0
  Running setup.py install for subinitial.stacks: started
    Running setup.py install for subinitial.stacks: finished with status 'done'
Successfully installed subinitial.stacks-1.14.1

Source Meter Usage and Examples

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.

Source Meter Documentation


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()));