32 #include <libphidget22/phidget22.h>
41 bool is_hub_port_device)
43 PhidgetReturnCode ret;
45 PhidgetVoltageOutputHandle ao_handle;
47 ret = PhidgetVoltageOutput_create(&ao_handle);
48 if (ret != EPHIDGET_OK)
51 "Failed to create AnalogOutput handle for determining channel "
56 PhidgetHandle handle =
reinterpret_cast<PhidgetHandle
>(ao_handle);
59 is_hub_port_device, 0);
61 ret = Phidget_getDeviceChannelCount(handle, PHIDCHCLASS_VOLTAGEOUTPUT,
66 if (ret != EPHIDGET_OK)
68 throw Phidget22Error(
"Failed to get AnalogOutput device channel count",
75 aos_[i] = std::make_unique<AnalogOutput>(serial_number, hub_port,
76 is_hub_port_device, i);
91 aos_.at(index)->setOutputVoltage(voltage);