Skip to content

Instantly share code, notes, and snippets.

@SimplyAhmazing
Last active August 2, 2017 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SimplyAhmazing/46ba9535e77b0dab4d0e14f22929ca32 to your computer and use it in GitHub Desktop.
Save SimplyAhmazing/46ba9535e77b0dab4d0e14f22929ca32 to your computer and use it in GitHub Desktop.
Shows an example of using the Opentrons API in Jupyter
# To use this API:
#
# Uninstall previously installed API
# pip uninstall -y opentrons
#
# Install API from here
# pip install "git+https://github.com/opentrons/opentrons@release-2.5.0#egg=opentrons&subdirectory=api"
# imports
from opentrons import robot, containers, instruments
# Uncomment line below and robot will connect to a robot
# robot.connect('/insert-serial-port-here')
# If you are already connected to a robot and want to return to simulation mode uncomment line below
# robot.set_connection('simulate')
# To switch back to a simulation connection, uncomment line below
# robot.set_connection('simulate')
# containers
plate = containers.load('96-flat', 'B1')
tiprack = containers.load('tiprack-200ul', 'A1')
# pipettes
pipette = instruments.Pipette(axis='b', max_volume=200, tip_racks=[tiprack])
# commands
pipette.transfer(100, plate.wells('A1'), plate.wells('B1'))
# Get list of commands run by the robot thus far (this is list of text only)
robot.commands()
# Clear commands from history
robot.reset()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment