Firmware for the DropBot digital microfluidics control system and a Python module for communicating with it over a serial connection.
The latest dropbot
release is available as a Conda package from the
sci-bots
channel.
To install dropbot
in an activated Conda environment, run:
conda install -c wheeler-microfluidics -c conda-forge dropbot
To upload the pre-compiled firmware included in the Python package, from an activated Conda environment run the following command:
python -m dropbot.bin.upload
The dropbot
Conda package includes:
dropbot.SerialProxy
Python class providing a high-level interface to the DropBot hardware.- Compiled firmware binary for the DropBot hardware.
The installed components (relative to the root of the Conda environment) are shown below:
├───Lib
│ └───site-packages
│ └───dropbot (Python package)
│
└───Library
└───bin
└───platformio
└───dropbot (compiled firmware binaries)
│ platformio.ini (PlatformIO environment information)
│
└───teensy31
firmware.hex
After uploading the firmware to the board, the dropbot.Proxy
class can be
used to interact with the Arduino device.
See the session log below for example usage.
>>> import dropbot
Connect to DropBot:
>>> proxy = dropbot.SerialProxy()
Query the number of bytes free in device RAM.
>>> proxy.ram_free()
409
Query descriptive properties of device.
>>> proxy.properties
base_node_software_version 0.9.post8.dev141722557
name dropbot
manufacturer Sci-Bots
url http://...
software_version 0.1
dtype: object
Use Arduino API methods interactively.
>>> # Set pin 13 as output
>>> proxy.pin_mode(13, 1)
>>> # Turn led on
>>> proxy.digital_write(13, 1)
>>> # Turn led off
>>> proxy.digital_write(13, 0)
Query number of available channels.
>>> proxy.number_of_channels()
120
Query state of all actuation channels.
>>> proxy.state_of_channels
The firmware C++ code is located in the src
directory. The key
functionality is defined in the dropbot::Node
class in the file
Node.h
.
New methods may be added to the Python API by adding new methods to the
dropbot::Node
C++ class in the file Node.h
.
-
Clone
dropbot
source code from GitHub repository. -
Run the following command within the root of the cloned repository to install run-time dependencies and link working copy of firmware binaries and Python package for run-time use:
paver develop_link
-
Restart terminal and reactivate Conda environment (e.g.,
activate
if Conda was installed with default settings).
Step 4 is necessary since at least one of the installed dependencies sets environment variables, which are only initialized on subsequent activations of the Conda environment (i.e., they do not take effect immediately within the running environment).
Run the following command within the root of the cloned repository to build the firmware:
paver build_firmware
The compiled firmware binary is available under the .pioenvs
directory, as
shown below:
└───.pioenvs
└───teensy31
firmware.hex
To flash/upload a compiled firmware to a DropBot v3, run the following command from the root of the repository:
pio run --target upload --target nobuild
Run the following command within the root of the cloned repository to unlink working copy of firmware binaries and Python package:
paver develop_unlink
This will allow, for example, installation of a main-line release of the
dropbot
Conda package.
- Christian Fobel (@cfobel)
- Ryan Fobel (@ryanfobel)