Theater ValveControl Firmware Interface

The motion control server uses the following module to communicate with the Arduino valve controllers running the ValveControl Arduino Sketch over USB serial.

stage.valves

valves.py : sample code in Python to communicate with an Arduino running ValveControl

No copyright, 2021-2024, Garth Zeglin. This file is explicitly placed in the public domain.

class stage.valves.ValveControlClient(port=None, verbose=False, debug=False, **kwargs)[source]

Class to manage a connection to a serial-connected Arduino running the ValveControl script.

Parameters:
  • port – the name of the serial port device

  • debug – true when debug log is enabled

  • verbose – flag to increase logging output

  • kwargs – collect any unused keyword arguments

close()[source]

Shut down the serial connection to the Arduino, after which this object may no longer be used.

send_empty()[source]

Issue a command to shut motion and exhaust all air.

send_move(joint, pwm)[source]

Issue a command to start an open-loop motion on the specified joint with the given pwm rate and return immediately.

Parameters:
  • joint – joint identifier (usually 1 or 2)

  • pwm – integer valve PWM from -100 to 100

send_stop()[source]

Issue a command to shut off all air flow.

wait_for_wakeup()[source]

Issue a status query and wait until status has been received.