Example #1
0
int MCDisplayProperties(CPhidgetMotorControlHandle phid)
{
	int serialNo, version, numInputs, numMotors;
	const char* ptr;

	CPhidget_getDeviceType((CPhidgetHandle)phid, &ptr);
	CPhidget_getSerialNumber((CPhidgetHandle)phid, &serialNo);
	CPhidget_getDeviceVersion((CPhidgetHandle)phid, &version);
	
	CPhidgetMotorControl_getInputCount(phid, &numInputs);
	CPhidgetMotorControl_getMotorCount(phid, &numMotors);

	SetupLog("%s", ptr);
	SetupLog("Serial Number: %10d\nVersion: %8d", serialNo, version);
	SetupLog("# Inputs: %d\n# Motors: %d", numInputs, numMotors);

	return 0;
}
int MotorDisplayProperties(CPhidgetMotorControlHandle phid)
{
	int serialNo, version, numInputs, numMotors;
	const char* ptr;

	CPhidget_getDeviceType((CPhidgetHandle)phid, &ptr);
	CPhidget_getSerialNumber((CPhidgetHandle)phid, &serialNo);
	CPhidget_getDeviceVersion((CPhidgetHandle)phid, &version);

	CPhidgetMotorControl_getInputCount(phid, &numInputs);
	CPhidgetMotorControl_getMotorCount(phid, &numMotors);

    #if (DEBUG_MODE_LOW)
	printf("%s\n", ptr);
	printf("Serial Number: %10d\nVersion: %8d\n", serialNo, version);
	printf("# Inputs: %d\n# Motors: %d\n", numInputs, numMotors);
    #endif

	return 0;
}
int display_properties(CPhidgetMotorControlHandle phid)
{
    int serial_number, version, num_motors, num_inputs;
    const char* ptr;

    CPhidget_getDeviceType((CPhidgetHandle)phid, &ptr);
    CPhidget_getSerialNumber((CPhidgetHandle)phid,
                             &serial_number);
    CPhidget_getDeviceVersion((CPhidgetHandle)phid, &version);

    CPhidgetMotorControl_getInputCount(phid, &num_inputs);
    CPhidgetMotorControl_getMotorCount(phid, &num_motors);

    ROS_INFO("%s", ptr);
    ROS_INFO("Serial Number: %d", serial_number);
    ROS_INFO("Version: %d", version);
    ROS_INFO("Number of motors %d", num_motors);
    ROS_INFO("Number of inputs %d", num_inputs);

    return 0;
}
Example #4
0
int display_properties(CPhidgetMotorControlHandle phid){
  int serialNo, version, numEncoders, numInputs, numMotors, numSensors, ratiometric;
  const char* ptr;

  CPhidget_getDeviceType((CPhidgetHandle)phid, &ptr);
  CPhidget_getSerialNumber((CPhidgetHandle)phid, &serialNo);
  CPhidget_getDeviceVersion((CPhidgetHandle)phid, &version);

  CPhidgetMotorControl_getEncoderCount(phid, &numEncoders);
  CPhidgetMotorControl_getInputCount(phid, &numInputs);
  CPhidgetMotorControl_getMotorCount(phid, &numMotors);
  CPhidgetMotorControl_getSensorCount(phid, &numSensors);
  CPhidgetMotorControl_getRatiometric(phid, &ratiometric);

  ROS_INFO("%s\n", ptr);
  ROS_INFO("Serial Number: %10d\nVersion: %8d\n", serialNo, version);
  ROS_INFO("# Encoders: %d\n", numEncoders);
  ROS_INFO("# Inputs: %d\n", numInputs);
  ROS_INFO("# Motors: %d\n", numMotors);
  ROS_INFO("# Sensors: %d\n", numSensors);
  ROS_INFO("Ratiometric: %d\n", ratiometric);

	return 0;
}