Class: Phidgets::VoltageOutput
- Defined in:
- lib/phidgets/voltage_output.rb,
ext/phidgets/phidgets_voltage_output.c
Constant Summary collapse
- VOLTAGE_OUTPUT_RANGE_10V =
INT2NUM(VOLTAGE_OUTPUT_RANGE_10V)
- VOLTAGE_OUTPUT_RANGE_5V =
INT2NUM(VOLTAGE_OUTPUT_RANGE_5V)
Instance Method Summary collapse
-
#getEnabled ⇒ Object
(also: #enabled?)
Enable the output voltage by setting Enabled to true.
-
#getMaxVoltage ⇒ Object
(also: #max_voltage)
The maximum value that Voltage can be set to.
-
#getMinVoltage ⇒ Object
(also: #min_voltage)
The minimum value that Voltage can be set to.
-
#getVoltage ⇒ Object
(also: #voltage)
The voltage value that the channel will output.
-
#getVoltageOutputRange ⇒ Object
(also: #voltage_output_range)
Choose a VoltageOutputRange that best suits your application.
-
#new ⇒ Object
constructor
Creates a Phidget VoltageOutput object.
-
#setEnabled(enabled) ⇒ Object
(also: #enabled=)
Enable the output voltage by setting Enabled to true.
-
#setVoltage(voltage) ⇒ Object
(also: #voltage=)
The voltage value that the channel will output.
-
#setVoltage_async(voltage, cb_proc = nil, &cb_block) ⇒ Object
(also: #set_voltage_async)
call-seq: setVoltage_async(voltage, proc=nil, &block).
-
#setVoltageOutputRange(output_range) ⇒ Object
(also: #voltage_output_range=)
Choose a VoltageOutputRange that best suits your application.
Methods inherited from Common
#close, #getAttached, #getChannel, #getChannelClass, #getChannelClassName, #getChannelName, #getChannelSubclass, #getDataInterval, #getDeviceChannelCount, #getDeviceClass, #getDeviceClassName, #getDeviceID, #getDeviceLabel, #getDeviceName, #getDeviceSKU, #getDeviceSerialNumber, #getDeviceVersion, #getHubPort, #getHubPortCount, #getIsChannel, #getIsHubPortDevice, #getIsLocal, #getIsRemote, #getServerHostname, #getServerName, #getServerPeerName, #getServerUniqueName, #open, #openWaitForAttachment, #setChannel, #setDataInterval, #setDeviceLabel, #setDeviceSerialNumber, #setHubPort, #setIsHubPortDevice, #setIsLocal, #setIsRemote, #setOnAttachHandler, #setOnDetachHandler, #setOnErrorHandler, #setOnPropertyChangeHandler, #setServerName, #writeDeviceLabel
Constructor Details
#new ⇒ Object
Creates a Phidget VoltageOutput object.
7 8 9 10 11 |
# File 'ext/phidgets/phidgets_voltage_output.c', line 7
VALUE ph_voltage_output_init(VALUE self) {
ph_data_t *ph = get_ph_data(self);
ph_raise(PhidgetVoltageOutput_create((PhidgetVoltageOutputHandle *)(&(ph->handle))));
return self;
}
|
Instance Method Details
#getEnabled ⇒ Object Also known as: enabled?
Enable the output voltage by setting Enabled to true. Disable the output by seting Enabled to false to save power.
13 14 15 |
# File 'ext/phidgets/phidgets_voltage_output.c', line 13
VALUE ph_voltage_output_get_enabled(VALUE self) {
return ph_get_bool(get_ph_handle(self), (phidget_get_bool_func)PhidgetVoltageOutput_getEnabled);
}
|
#getMaxVoltage ⇒ Object Also known as: max_voltage
The maximum value that Voltage can be set to.
35 36 37 |
# File 'ext/phidgets/phidgets_voltage_output.c', line 35
VALUE ph_voltage_output_get_max_voltage(VALUE self) {
return ph_get_double(get_ph_handle(self), (phidget_get_double_func)PhidgetVoltageOutput_getMaxVoltage);
}
|
#getMinVoltage ⇒ Object Also known as: min_voltage
The minimum value that Voltage can be set to.
31 32 33 |
# File 'ext/phidgets/phidgets_voltage_output.c', line 31
VALUE ph_voltage_output_get_min_voltage(VALUE self) {
return ph_get_double(get_ph_handle(self), (phidget_get_double_func)PhidgetVoltageOutput_getMinVoltage);
}
|
#getVoltage ⇒ Object Also known as: voltage
The voltage value that the channel will output. The Voltage value is bounded by MinVoltage and MaxVoltage. The voltage value will not be output until Enabled is set to true.
22 23 24 |
# File 'ext/phidgets/phidgets_voltage_output.c', line 22
VALUE ph_voltage_output_get_voltage(VALUE self) {
return ph_get_double(get_ph_handle(self), (phidget_get_double_func)PhidgetVoltageOutput_getVoltage);
}
|
#getVoltageOutputRange ⇒ Object Also known as: voltage_output_range
Choose a VoltageOutputRange that best suits your application. Changing the VoltageOutputRange will also affect the MinVoltage and MaxVoltage values.
39 40 41 |
# File 'ext/phidgets/phidgets_voltage_output.c', line 39
VALUE ph_voltage_output_get_voltage_output_range(VALUE self) {
return ph_get_int(get_ph_handle(self), (phidget_get_int_func)PhidgetVoltageOutput_getVoltageOutputRange);
}
|
#setEnabled(enabled) ⇒ Object Also known as: enabled=
Enable the output voltage by setting Enabled to true. Disable the output by seting Enabled to false to save power.
17 18 19 20 |
# File 'ext/phidgets/phidgets_voltage_output.c', line 17
VALUE ph_voltage_output_set_enabled(VALUE self, VALUE enabled) {
ph_raise(PhidgetVoltageOutput_setEnabled((PhidgetVoltageOutputHandle)get_ph_handle(self), TYPE(enabled) == T_TRUE ? PTRUE : PFALSE));
return Qnil;
}
|
#setVoltage(voltage) ⇒ Object Also known as: voltage=
The voltage value that the channel will output. The Voltage value is bounded by MinVoltage and MaxVoltage. The voltage value will not be output until Enabled is set to true.
26 27 28 29 |
# File 'ext/phidgets/phidgets_voltage_output.c', line 26
VALUE ph_voltage_output_set_voltage(VALUE self, VALUE voltage) {
ph_raise(PhidgetVoltageOutput_setVoltage((PhidgetVoltageOutputHandle)get_ph_handle(self), NUM2DBL(voltage)));
return Qnil;
}
|
#setVoltage_async(voltage, cb_proc = nil, &cb_block) ⇒ Object Also known as: set_voltage_async
call-seq:
setVoltage_async(voltage, proc=nil, &block)
The voltage value that the channel will output. The Voltage value is bounded by MinVoltage and MaxVoltage. The voltage value will not be output until Enabled is set to true.
13 14 15 16 17 |
# File 'lib/phidgets/voltage_output.rb', line 13 def setVoltage_async(voltage, cb_proc = nil, &cb_block) @voltage_async_thread.kill if defined? @voltage_async_thread and @voltage_async_thread.alive? callback = cb_proc || cb_block @voltage_async_thread = Thread.new {ext_setVoltage_async(voltage, callback)} end |
#setVoltageOutputRange(output_range) ⇒ Object Also known as: voltage_output_range=
Choose a VoltageOutputRange that best suits your application. Changing the VoltageOutputRange will also affect the MinVoltage and MaxVoltage values.
43 44 45 46 |
# File 'ext/phidgets/phidgets_voltage_output.c', line 43
VALUE ph_voltage_output_set_voltage_output_range(VALUE self, VALUE output_range) {
ph_raise(PhidgetVoltageOutput_setVoltageOutputRange((PhidgetVoltageOutputHandle)get_ph_handle(self), NUM2INT(output_range)));
return Qnil;
}
|