| typedef struct _CPhidgetMotorControl* CPhidgetMotorControlHandle |
A Phidget MotorControl handle
| int CPhidgetMotorControl_create | ( | CPhidgetMotorControlHandle * | phid | ) |
Creates a Phidget MotorControl handle.
| phid | A pointer to an unallocated Phidget MotorControl handle. |
| int CPhidgetMotorControl_getMotorCount | ( | CPhidgetMotorControlHandle | phid, | |
| int * | count | |||
| ) |
Gets the number of motors supported by this controller.
| phid | An attached phidget motor control handle. | |
| count | The motor count. |
| int CPhidgetMotorControl_getVelocity | ( | CPhidgetMotorControlHandle | phid, | |
| int | index, | |||
| double * | velocity | |||
| ) |
Gets the current velocity of a motor.
| phid | An attached phidget motor control handle. | |
| index | The motor index. | |
| velocity | The current velocity. |
| int CPhidgetMotorControl_setVelocity | ( | CPhidgetMotorControlHandle | phid, | |
| int | index, | |||
| double | velocity | |||
| ) |
Sets the velocity of a motor.
| phid | An attached phidget motor control handle. | |
| index | The motor index. | |
| velocity | The velocity. |
| int CPhidgetMotorControl_set_OnVelocityChange_Handler | ( | CPhidgetMotorControlHandle | phid, | |
| int(*)(CPhidgetMotorControlHandle phid, void *userPtr, int index, double velocity) | fptr, | |||
| void * | userPtr | |||
| ) |
Sets a velocity change event handler. This is called when the velocity changes.
| phid | An attached phidget motor control handle. | |
| fptr | Callback function pointer. | |
| userPtr | A pointer for use by the user - this value is passed back into the callback function. |
| int CPhidgetMotorControl_getAcceleration | ( | CPhidgetMotorControlHandle | phid, | |
| int | index, | |||
| double * | acceleration | |||
| ) |
Gets the last set acceleration of a motor.
| phid | An attached phidget motor control handle. | |
| index | The motor index. | |
| acceleration | The acceleration. |
| int CPhidgetMotorControl_setAcceleration | ( | CPhidgetMotorControlHandle | phid, | |
| int | index, | |||
| double | acceleration | |||
| ) |
Sets the last set acceleration of a motor.
| phid | An attached phidget motor control handle. | |
| index | The motor index. | |
| acceleration | The acceleration. |
| int CPhidgetMotorControl_getAccelerationMax | ( | CPhidgetMotorControlHandle | phid, | |
| int | index, | |||
| double * | max | |||
| ) |
Gets the maximum acceleration supported by a motor
| phid | An attached phidget motor control handle | |
| index | The motor index. | |
| max | The maximum acceleration. |
| int CPhidgetMotorControl_getAccelerationMin | ( | CPhidgetMotorControlHandle | phid, | |
| int | index, | |||
| double * | min | |||
| ) |
Gets the minimum acceleration supported by a motor.
| phid | An attached phidget motor control handle | |
| index | The motor index. | |
| min | The minimum acceleration |
| int CPhidgetMotorControl_getCurrent | ( | CPhidgetMotorControlHandle | phid, | |
| int | index, | |||
| double * | current | |||
| ) |
Gets the current current draw for a motor.
| phid | An attached phidget motor control handle | |
| index | The motor index. | |
| current | The current. |
| int CPhidgetMotorControl_set_OnCurrentChange_Handler | ( | CPhidgetMotorControlHandle | phid, | |
| int(*)(CPhidgetMotorControlHandle phid, void *userPtr, int index, double current) | fptr, | |||
| void * | userPtr | |||
| ) |
Sets a current change event handler. This is called when the current draw changes.
| phid | An attached phidget motor control handle | |
| fptr | Callback function pointer. | |
| userPtr | A pointer for use by the user - this value is passed back into the callback function. |
| int CPhidgetMotorControl_getInputCount | ( | CPhidgetMotorControlHandle | phid, | |
| int * | count | |||
| ) |
Gets the number of digital inputs supported by this board.
| phid | An attached phidget motor control handle. | |
| count | The ditial input count. |
| int CPhidgetMotorControl_getInputState | ( | CPhidgetMotorControlHandle | phid, | |
| int | index, | |||
| int * | inputState | |||
| ) |
| int CPhidgetMotorControl_set_OnInputChange_Handler | ( | CPhidgetMotorControlHandle | phid, | |
| int(*)(CPhidgetMotorControlHandle phid, void *userPtr, int index, int inputState) | fptr, | |||
| void * | userPtr | |||
| ) |
Set a digital input change handler. This is called when a digital input changes.
| phid | An attached phidget motor control handle. | |
| fptr | Callback function pointer. | |
| userPtr | A pointer for use by the user - this value is passed back into the callback function. |
| int CPhidgetMotorControl_getEncoderCount | ( | CPhidgetMotorControlHandle | phid, | |
| int * | count | |||
| ) |
Gets the number of encoder inputs supported by this board.
| phid | An attached phidget motor control handle. | |
| count | The encoder input count. |
| int CPhidgetMotorControl_getEncoderPosition | ( | CPhidgetMotorControlHandle | phid, | |
| int | index, | |||
| int * | position | |||
| ) |
Gets the position of an encoder. This position starts at 0 every time the phidget is opened.
| phid | An attached phidget motor control handle. | |
| index | The encoder index. | |
| position | The encoder position. |
| int CPhidgetMotorControl_setEncoderPosition | ( | CPhidgetMotorControlHandle | phid, | |
| int | index, | |||
| int | position | |||
| ) |
Sets the encoder position. This can be used to set the position to a known value, and should only be called when the encoder is not moving.
| phid | An attached phidget motor control handle. | |
| index | The encoder index. | |
| position | The encoder position. |
| int CPhidgetMotorControl_set_OnEncoderPositionChange_Handler | ( | CPhidgetMotorControlHandle | phid, | |
| int(*)(CPhidgetMotorControlHandle phid, void *userPtr, int index, int time, int positionChange) | fptr, | |||
| void * | userPtr | |||
| ) |
Set an encoder position change handler. This is called when the encoder position changes.
| phid | An attached phidget motor control handle. | |
| fptr | Callback function pointer. | |
| userPtr | A pointer for use by the user - this value is passed back into the callback function. |
| int CPhidgetMotorControl_set_OnEncoderPositionUpdate_Handler | ( | CPhidgetMotorControlHandle | phid, | |
| int(*)(CPhidgetMotorControlHandle phid, void *userPtr, int index, int positionChange) | fptr, | |||
| void * | userPtr | |||
| ) |
Set an encoder position update handler. This is called at a constant rate; every 8ms, whether the encoder position has changed or not.
| phid | An attached phidget motor control handle. | |
| fptr | Callback function pointer. | |
| userPtr | A pointer for use by the user - this value is passed back into the callback function. |
| int CPhidgetMotorControl_getBackEMFSensingState | ( | CPhidgetMotorControlHandle | phid, | |
| int | index, | |||
| int * | bEMFState | |||
| ) |
Gets the Back EMF sensing state for a motor.
| phid | An attached phidget motor control handle. | |
| index | The motor index. | |
| bEMFState | The back EMF sensing state. |
| int CPhidgetMotorControl_setBackEMFSensingState | ( | CPhidgetMotorControlHandle | phid, | |
| int | index, | |||
| int | bEMFState | |||
| ) |
Sets the Back EMF sensing state for a motor.
| phid | An attached phidget motor control handle. | |
| index | The motor index. | |
| bEMFState | The back EMF sensing state. |
| int CPhidgetMotorControl_getBackEMF | ( | CPhidgetMotorControlHandle | phid, | |
| int | index, | |||
| double * | voltage | |||
| ) |
Gets the Back EMF voltage for a motor.
| phid | An attached phidget motor control handle. | |
| index | The motor index. | |
| voltage | The back EMF voltage, in volts. |
| int CPhidgetMotorControl_set_OnBackEMFUpdate_Handler | ( | CPhidgetMotorControlHandle | phid, | |
| int(*)(CPhidgetMotorControlHandle phid, void *userPtr, int index, double voltage) | fptr, | |||
| void * | userPtr | |||
| ) |
Set a back EMF update handler. This is called at a constant rate; every 16ms, when back EMF sensing is enabled for that motor.
| phid | An attached phidget motor control handle. | |
| fptr | Callback function pointer. | |
| userPtr | A pointer for use by the user - this value is passed back into the callback function. |
| int CPhidgetMotorControl_getSupplyVoltage | ( | CPhidgetMotorControlHandle | phid, | |
| double * | supplyVoltage | |||
| ) |
Gets the Supply voltage for the motors. This could be higher then the actual supply voltage.
| phid | An attached phidget motor control handle. | |
| supplyVoltage | The supply voltage, in volts. |
| int CPhidgetMotorControl_getBraking | ( | CPhidgetMotorControlHandle | phid, | |
| int | index, | |||
| double * | braking | |||
| ) |
Gets the Braking value for a motor.
| phid | An attached phidget motor control handle. | |
| index | The motor index. | |
| braking | The braking value, in percent. |
| int CPhidgetMotorControl_setBraking | ( | CPhidgetMotorControlHandle | phid, | |
| int | index, | |||
| double | braking | |||
| ) |
Sets the Braking value for a motor. This is applied when velocity is 0. Default is 0%.
| phid | An attached phidget motor control handle. | |
| index | The motor index. | |
| braking | The braking value, in percent. |
| int CPhidgetMotorControl_getSensorCount | ( | CPhidgetMotorControlHandle | phid, | |
| int * | count | |||
| ) |
Gets the number of sensor inputs supported by this board.
| phid | An attached phidget motor control handle. | |
| count | The sensor input count. |
| int CPhidgetMotorControl_getSensorValue | ( | CPhidgetMotorControlHandle | phid, | |
| int | index, | |||
| int * | sensorValue | |||
| ) |
Gets the value of a sensor.
| phid | An attached phidget motor control handle. | |
| index | The sensor index. | |
| sensorValue | The sensor value, range: 0-1000. |
| int CPhidgetMotorControl_getSensorRawValue | ( | CPhidgetMotorControlHandle | phid, | |
| int | index, | |||
| int * | sensorRawValue | |||
| ) |
Gets the raw value of a sensor (12-bit).
| phid | An attached phidget motor control handle. | |
| index | The sensor index. | |
| sensorRawValue | The sensor value, range: 0-4096. |
| int CPhidgetMotorControl_set_OnSensorUpdate_Handler | ( | CPhidgetMotorControlHandle | phid, | |
| int(*)(CPhidgetMotorControlHandle phid, void *userPtr, int index, int sensorValue) | fptr, | |||
| void * | userPtr | |||
| ) |
Set a sensor update handler. This is called at a constant rate; every 8ms.
| phid | An attached phidget motor control handle. | |
| fptr | Callback function pointer. | |
| userPtr | A pointer for use by the user - this value is passed back into the callback function. |
| int CPhidgetMotorControl_getRatiometric | ( | CPhidgetMotorControlHandle | phid, | |
| int * | ratiometric | |||
| ) |
Gets the ratiometric state.
| phid | An attached phidget motor control handle. | |
| ratiometric | The ratiometric state. |
| int CPhidgetMotorControl_setRatiometric | ( | CPhidgetMotorControlHandle | phid, | |
| int | ratiometric | |||
| ) |
Sets the ratiometric state. This control the voltage reference used for sampling the analog sensors.
| phid | An attached phidget motor control handle. | |
| ratiometric | The ratiometric state. |
| int CPhidgetMotorControl_set_OnCurrentUpdate_Handler | ( | CPhidgetMotorControlHandle | phid, | |
| int(*)(CPhidgetMotorControlHandle phid, void *userPtr, int index, double current) | fptr, | |||
| void * | userPtr | |||
| ) |
Set a current update handler. This is called at a constant rate; every 8ms.
| phid | An attached phidget motor control handle. | |
| fptr | Callback function pointer. | |
| userPtr | A pointer for use by the user - this value is passed back into the callback function. |
1.5.9