Relay¶
See the Relay Entity for generic information.
- class brainstem.entity.Relay(module, index)[source]¶
Interface to relay entities on BrainStem modules. Relay entities can be set, and the voltage read. Other capabilities may be available, please see the product datasheet.
- getEnable()[source]¶
Get the state.
- Returns:
- Object containing error code and returned value on success.
- errorunsigned byte
An error result from the list of defined error codes
- valuebool
False or 0 = Disabled, True or 1 = Enabled
- Return type:
- getVoltage()[source]¶
Get the scaled micro volt value with reference to ground.
Note
Not all modules provide 32 bits of accuracy. Refer to the module’s datasheet to determine the analog bit depth and reference voltage.
- Returns:
- Object containing error code and returned value on success.
- errorunsigned byte
An error result from the list of defined error codes
- valueint
32 bit signed integer (in micro Volts) based on the boards ground and reference voltages.
- Return type: