pyoperant.hwio module¶
-
class
pyoperant.hwio.
AudioOutput
(interface=None, params={}, *args, **kwargs)[source]¶ Bases:
pyoperant.hwio.BaseIO
Class which holds information about audio outputs and abstracts the methods of writing to them
Keyword arguments: interface – Interface() instance. Must have the methods ‘_queue_wav’,
‘_play_wav’, ‘_stop_wav’params – dictionary of keyword:value pairs needed by the interface
Methods: queue(wav_filename) – queues read() – if the interface supports ‘_read_bool’ for this output, returns
the current value of the output from the interface. Otherwise this returns the last passed by write(value)toggle() – flips the value from the current value
-
class
pyoperant.hwio.
BaseIO
(interface=None, params={}, *args, **kwargs)[source]¶ Bases:
object
any type of IO device. maintains info on interface for query IO device
-
class
pyoperant.hwio.
BooleanInput
(interface=None, params={}, *args, **kwargs)[source]¶ Bases:
pyoperant.hwio.BaseIO
Class which holds information about inputs and abstracts the methods of querying their values
Keyword arguments: interface – Interface() instance. Must have ‘_read_bool’ method. params – dictionary of keyword:value pairs needed by the interface
Methods: read() – reads value of the input. Returns a boolean poll() – polls the input until value is True. Returns the time of the change
-
class
pyoperant.hwio.
BooleanOutput
(interface=None, params={}, *args, **kwargs)[source]¶ Bases:
pyoperant.hwio.BaseIO
Class which holds information about outputs and abstracts the methods of writing to them
Keyword arguments: interface – Interface() instance. Must have ‘_write_bool’ method. params – dictionary of keyword:value pairs needed by the interface
Methods: write(value) – writes a value to the output. Returns the value read() – if the interface supports ‘_read_bool’ for this output, returns
the current value of the output from the interface. Otherwise this returns the last passed by write(value)toggle() – flips the value from the current value
-
class
pyoperant.hwio.
PWMOutput
(interface=None, params={}, *args, **kwargs)[source]¶ Bases:
pyoperant.hwio.BaseIO
Class which abstracts the writing to PWM outputs
Keyword Arguments: interface – Interface() instance. Must have ‘_write_bool’ method.
params – dictionary of keyword:value pairs needed by the interface
Methods
write(value) – writes a value to the output. Returns the value
read() – if the interface supports ‘_read_bool’ for this output, returns –
the current value of the output from the interface. Otherwise this returns the last passed by write(value)