class Voltage Reference¶
Control the voltage reference output to generate a reference voltage on the given hardware port.
Constructor¶
-
class
omc048.
voltage_ref
(id: integer)¶ Create a voltage reference object associated with a voltage reference hardware port.
id
is the voltage reference hardware number, on the OMC-048 the “id” is “1” corresponding to pin 17.
Methods¶
-
voltage_ref.
set
(state: integer)¶ Set the reference output on or off.
state
is 1 or 0, corresponding to on and off.
-
voltage_ref.
on
()¶ Enable reference output to the port.
-
voltage_ref.
off
()¶ Disable reference output to the port.
-
voltage_ref.
toggle
()¶ Switch the reference output state from the current to the other state. Turning it on when it was off and off when it was on.
Example¶
The following example enables the reference output (generating 2.5V as a reference), then turns the reference off after 5 seconds. Then again after 5 seconds the reference is toggled, which sets the reference output on again.
import omc048
import time
ref1 = omc048.voltage_ref(1)
ref1.on()
time.sleep(5)
ref1.off()
time.sleep(5)
ref1.toggle()