//Display the properties of the attached phidget to the screen. We will be displaying the name, serial number and version of the attached device. int ASDisplayProperties(CPhidgetAdvancedServoHandle phid) { int serialNo, version, numMotors; const char* ptr; CPhidget_getDeviceType((CPhidgetHandle)phid, &ptr); CPhidget_getSerialNumber((CPhidgetHandle)phid, &serialNo); CPhidget_getDeviceVersion((CPhidgetHandle)phid, &version); CPhidgetAdvancedServo_getMotorCount (phid, &numMotors); SetupLog("%s", ptr); SetupLog("Serial Number: %10d\nVersion: %8d\n# Motors: %d", serialNo, version, numMotors); return 0; }
void display_properties( CPhidgetAdvancedServoHandle phid ) { int serialNo, version, numMotors; const char* ptr; CPhidget_getDeviceType((CPhidgetHandle)phid, &ptr); CPhidget_getSerialNumber((CPhidgetHandle)phid, &serialNo); CPhidget_getDeviceVersion((CPhidgetHandle)phid, &version); CPhidgetAdvancedServo_getMotorCount (phid, &numMotors); printf("%s\n", ptr); printf("Serial Number: %10d\nVersion: %8d\n# Motors: %d\n", serialNo, version, numMotors); printf( "Parameters:\nmin acceleration: %f\nmax acceleration: %f\nmin velocity: %f\nmax velocity: %f\n", minAcc, maxAcc, minVel, maxVel ); }