Esempio n. 1
0
//Display the properties of the attached phidget to the screen.  We will be displaying the name, serial number and version of the attached device.
//Will also display the number of inputs, outputs, and analog inputs on the interface kit as well as the state of the ratiometric flag
//and the current analog sensor sensitivity.
int IKDisplayProperties(CPhidgetInterfaceKitHandle phid)
{
	int serialNo, version, numInputs, numOutputs, numSensors, triggerVal, ratiometric, i;
	const char* ptr;

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

	CPhidgetInterfaceKit_getInputCount(phid, &numInputs);
	CPhidgetInterfaceKit_getOutputCount(phid, &numOutputs);
	CPhidgetInterfaceKit_getSensorCount(phid, &numSensors);
	CPhidgetInterfaceKit_getRatiometric(phid, &ratiometric);

	SetupLog("%s", ptr);
	SetupLog("Serial Number: %10d\nVersion: %8d", serialNo, version);
	SetupLog("# Digital Inputs: %d\n# Digital Outputs: %d", numInputs, numOutputs);
	SetupLog("# Sensors: %d", numSensors);
	SetupLog("Ratiometric: %d", ratiometric);

	for(i = 0; i < numSensors; i++)
	{
		CPhidgetInterfaceKit_getSensorChangeTrigger (phid, i, &triggerVal);

		SetupLog("Sensor#: %d > Sensitivity Trigger: %d\n", i, triggerVal);
	}

	return 0;
}
Esempio n. 2
0
void imuPrintInfo( void* handle )
{
	if( !handle )
		return;

	CPhidgetHandle phid = (CPhidgetHandle)handle;

	int serialNo = 0;
	int version = 0;
	const char* ptr;
	int numAccelAxes = 0, numGyroAxes = 0, numCompassAxes = 0;
	int dataRateMax = 0, dataRateMin = 0, dataRateCurr = 0;

	//CPhidget_getDeviceType(phid, &ptr);
	//printf("IMU  %s\n", ptr);

	CPhidget_getSerialNumber(phid, &serialNo);
	CPhidget_getDeviceVersion(phid, &version);
	CPhidgetSpatial_getAccelerationAxisCount((CPhidgetSpatialHandle)phid, &numAccelAxes);
	CPhidgetSpatial_getGyroAxisCount((CPhidgetSpatialHandle)phid, &numGyroAxes);
	CPhidgetSpatial_getCompassAxisCount((CPhidgetSpatialHandle)phid, &numCompassAxes);
	CPhidgetSpatial_getDataRateMax((CPhidgetSpatialHandle)phid, &dataRateMax);
	CPhidgetSpatial_getDataRateMin((CPhidgetSpatialHandle)phid, &dataRateMin);
	CPhidgetSpatial_getDataRate((CPhidgetSpatialHandle)phid, &dataRateCurr);
	
	
	printf("IMU  Serial Number: %10i\n", serialNo);
	printf("IMU  Version: %8i\n", version);
	printf("IMU  Number of Accel Axes: %i\n", numAccelAxes);
	printf("IMU  Number of Gyro Axes: %i\n", numGyroAxes);
	printf("IMU  Number of Compass Axes: %i\n", numCompassAxes);
	printf("IMU  datarate>   Min: %d  Max: %d  Current: %d\n", dataRateMin, dataRateMax, dataRateCurr);
}
Esempio n. 3
0
int display_properties(CPhidgetPHSensorHandle phid)
{
    int serialNo, version;
    double trigger, potential;
    double min, max;
    const char* ptr;

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

    CPhidgetPHSensor_getPHChangeTrigger(phid, &trigger);
    CPhidgetPHSensor_getPotential(phid, &potential);

    ROS_INFO("%s\n", ptr);
    ROS_INFO("Serial Number: %10d\nVersion: %8d\n",
			 serialNo, version);
    ROS_INFO("Trigger Sensitivity: %f\nPotential: %f\n",
			 trigger, potential);
    CPhidgetPHSensor_getPHMax(phid, &max);
    CPhidgetPHSensor_getPHMin(phid, &min);
    ROS_INFO("Max PH: %0.4lf, Min PH: %0.4lf\n", max, min);
    CPhidgetPHSensor_getPotentialMax(phid, &max);
    CPhidgetPHSensor_getPotentialMin(phid, &min);
    ROS_INFO("Max Potential: %0.2lfmV, " \
			 "Min Potential: %0.2lfmV\n", max, min);

    return 0;
}
//Display the properties of the attached phidget(s) to the screen.  We will be displaying the name, serial number and version of the attached device(s).
int display_devices(CPhidgetManagerHandle MAN)
{
	int serialNo, version, numDevices, i;
	const char* ptr;
	CPhidgetHandle *devices;

	CPhidgetManager_getAttachedDevices (MAN, &devices, &numDevices);

	printf("|-   # -|-              Type              -|- Serial No. -|-  Version -|\n");
	printf("|-------|----------------------------------|--------------|------------|\n");


	for(i = 0; i < numDevices; i++)
	{
		CPhidget_getDeviceType(devices[i], &ptr);
		CPhidget_getSerialNumber(devices[i], &serialNo);
		CPhidget_getDeviceVersion(devices[i], &version);

		printf("|- %3d -|- %30s -|- %10d -|- %8d -|\n", i, ptr, serialNo, version);
		printf("|-------|----------------------------------|--------------|------------|\n");
	}

	CPhidgetManager_freeAttachedDevicesArray(devices);

	return 0;
}
Esempio n. 5
0
int display_properties(CPhidgetAccelerometerHandle phid)
{
    int serial_number, version, num_axes;
    const char* ptr;

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

    CPhidgetAccelerometer_getAxisCount((CPhidgetAccelerometerHandle)phid,
									   &num_axes);

    // initialise acceleration values
    ros::Time begin = ros::Time::now();
    acc.acceleration.clear();
    acc.stamp.clear();
    for (int i = 0; i < num_axes; i++) {
        acc.acceleration.push_back(0);
        acc.stamp.push_back(begin);
        acc.stamp.push_back(begin);
        acc.stamp.push_back(begin);
    }

    ROS_INFO("%s", ptr);
    ROS_INFO("Serial Number: %d", serial_number);
    ROS_INFO("Version: %d", version);
    ROS_INFO("Number of axes %d", num_axes);

    return 0;
}
// display the properties and create the ifkit model. Should really refactor...
int PhidgetConnector::display_properties(CPhidgetInterfaceKitHandle phid) {

    int serialNo, version, numInputs, numOutputs, numSensors, triggerVal, ratiometric, i;
    const char* ptr;

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

    CPhidgetInterfaceKit_getInputCount(phid, &numInputs);
    CPhidgetInterfaceKit_getOutputCount(phid, &numOutputs);
    CPhidgetInterfaceKit_getSensorCount(phid, &numSensors);
    CPhidgetInterfaceKit_getRatiometric(phid, &ratiometric);
    ifKitModels.push_back(new IFKitModel(serialNo, numSensors));



    printf("%s\n", ptr);
    printf("Serial Number: %10d\nVersion: %8d\n", serialNo, version);
    printf("# Digital Inputs: %d\n# Digital Outputs: %d\n", numInputs, numOutputs);
    printf("# Sensors: %d\n", numSensors);
    printf("Ratiometric: %d\n", ratiometric);

    for(i = 0; i < numSensors; i++) {
        CPhidgetInterfaceKit_setSensorChangeTrigger(phid, i, 0);
        CPhidgetInterfaceKit_getSensorChangeTrigger (phid, i, &triggerVal);
        printf("Sensor#: %d > Sensitivity Trigger: %d\n", i, triggerVal);
    }

    return 0;
}
int display_properties(CPhidgetInterfaceKitHandle phid)
{
    int serial_number, version, ratiometric, num_sensors, num_inputs, num_outputs, triggerVal;
    const char* ptr;

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

    CPhidgetInterfaceKit_getInputCount(phid, &num_inputs);
    CPhidgetInterfaceKit_getOutputCount(phid, &num_outputs);
    CPhidgetInterfaceKit_getSensorCount(phid, &num_sensors);
    CPhidgetInterfaceKit_getRatiometric(phid, &ratiometric);

    ROS_INFO("%s", ptr);
    ROS_INFO("Serial Number: %d", serial_number);
    ROS_INFO("Version: %d", version);
    ROS_INFO("Number of digital inputs %d", num_inputs);
    ROS_INFO("Number of digital outputs %d", num_outputs);
    ROS_INFO("Number of sensors %d", num_sensors);
    ROS_INFO("Ratiometric %d", ratiometric);

    for (int i = 0; i < num_sensors; i++)
    {       
        CPhidgetInterfaceKit_getSensorChangeTrigger (phid, i, &triggerVal);
        //CPhidgetInterfaceKit_setSensorChangeTrigger (phid, i, 10);
	ROS_INFO("Sensor %d Sensitivity Trigger %d", i, triggerVal);
    }

    return 0;
}
Esempio n. 8
0
//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 display_properties(CPhidgetTextLCDHandle phid)
{
	int serialNo, version, numRows, numColumns, backlight, cursor, contrast, cursor_blink, numScreens;
	const char* ptr;
	CPhidget_DeviceID id;
	
	CPhidget_getDeviceType((CPhidgetHandle)phid, &ptr);
	CPhidget_getSerialNumber((CPhidgetHandle)phid, &serialNo);
	CPhidget_getDeviceVersion((CPhidgetHandle)phid, &version);
	CPhidget_getDeviceID((CPhidgetHandle)phid, &id);

	CPhidgetTextLCD_getRowCount (phid, &numRows);
	CPhidgetTextLCD_getColumnCount (phid, &numColumns);
	CPhidgetTextLCD_getBacklight (phid, &backlight);
	CPhidgetTextLCD_getContrast (phid, &contrast);
	CPhidgetTextLCD_getCursorOn (phid, &cursor);
	CPhidgetTextLCD_getCursorBlink (phid, &cursor_blink);

	printf("%s\n", ptr);
	printf("Serial Number: %10d\nVersion: %8d\n", serialNo, version);
	if(id == PHIDID_TEXTLCD_ADAPTER){
		CPhidgetTextLCD_getScreenCount (phid, &numScreens);
		printf("# Screens: %d\n", numScreens);
		CPhidgetTextLCD_setScreen(phid, 0);
		CPhidgetTextLCD_setScreenSize(phid, PHIDGET_TEXTLCD_SCREEN_2x16);
		CPhidgetTextLCD_initialize(phid);
	}

	printf("# Rows: %d\n# Columns: %d\n", numRows, numColumns);
	printf("Current Contrast Level: %d\nBacklight Status: %d\n", contrast, backlight);
	printf("Cursor Status: %d\nCursor Blink Status: %d\n", cursor, cursor_blink);

	return 0;
}
Esempio n. 9
0
int display_properties(CPhidgetSpatialHandle phid)
{
    int serialNo, version;
    const char* ptr;
    int numAccelAxes, numGyroAxes, numCompassAxes;
	int dataRateMax, dataRateMin;

    CPhidget_getDeviceType((CPhidgetHandle)phid, &ptr);
    CPhidget_getSerialNumber((CPhidgetHandle)phid, &serialNo);
    CPhidget_getDeviceVersion((CPhidgetHandle)phid, &version);
    CPhidgetSpatial_getAccelerationAxisCount((CPhidgetSpatialHandle)phid,
											 &numAccelAxes);
    CPhidgetSpatial_getGyroAxisCount((CPhidgetSpatialHandle)phid,
									 &numGyroAxes);
    CPhidgetSpatial_getCompassAxisCount((CPhidgetSpatialHandle)phid,
										&numCompassAxes);
    CPhidgetSpatial_getDataRateMax((CPhidgetSpatialHandle)phid,
								   &dataRateMax);
    CPhidgetSpatial_getDataRateMin((CPhidgetSpatialHandle)phid,
								   &dataRateMin);

    ROS_INFO("%s\n", ptr);
    ROS_INFO("Serial Number: %10d\nVersion: %8d\n",
			 serialNo, version);
    ROS_INFO("Number of Accel Axes: %i\n", numAccelAxes);
    ROS_INFO("Number of Gyro Axes: %i\n", numGyroAxes);
    ROS_INFO("Number of Compass Axes: %i\n", numCompassAxes);
    ROS_INFO("datarate> Max: %d  Min: %d\n",
			 dataRateMax, dataRateMin);

    return 0;
}
Wt::WContainerWidget* WidgetsCommon::CreateWidget()
{
	PhidgetsInfo* item = ::GetPhidgetManager()->FindPhidgetBySerial(GetSerial());
	if (!item)
		return NULL;
	
	CPhidgetHandle handle = item->m_phidget->GetHandle();

	Wt::WContainerWidget* tab_container = new Wt::WContainerWidget();
  Wt::WHBoxLayout* hbox = new Wt::WHBoxLayout(tab_container);
	
	Wt::WTable* table = new Wt::WTable();
	hbox->addWidget(table);
	
	table->columnAt(0)->setWidth(GetLeftColumnWidth());
	table->columnAt(1)->setWidth(Wt::WLength::Auto);

	int row = 0;
	const char* string_value;
	int int_value;
	if (EPHIDGET_OK == CPhidget_getDeviceName(handle, &string_value))
	{
		table->elementAt(row, 0)->addWidget(new Wt::WText(Wt::WString::tr("DeviceName")));
		table->elementAt(row++, 1)->addWidget(new Wt::WText(Wt::WString(string_value, Wt::UTF8)));
	}
	
	if (EPHIDGET_OK == CPhidget_getSerialNumber(handle, &int_value))
	{
		table->elementAt(row, 0)->addWidget(new Wt::WText(Wt::WString::tr("SerialNumber")));
		table->elementAt(row++, 1)->addWidget(new Wt::WText(Wt::WString("{1}").arg(int_value)));
	}

	if (EPHIDGET_OK == CPhidget_getDeviceVersion(handle, &int_value))
	{
		table->elementAt(row, 0)->addWidget(new Wt::WText(Wt::WString::tr("DeviceVersion")));
		table->elementAt(row++, 1)->addWidget(new Wt::WText(Wt::WString("{1}").arg(int_value)));
	}

	if (EPHIDGET_OK == CPhidget_getDeviceStatus(handle, &int_value))
	{
		table->elementAt(row, 0)->addWidget(new Wt::WText(Wt::WString::tr("DeviceStatus")));
		table->elementAt(row++, 1)->addWidget(new Wt::WText(Wt::WString("{1}").arg(int_value)));
	}

	if (EPHIDGET_OK == CPhidget_getDeviceType(handle, &string_value))
	{
		table->elementAt(row, 0)->addWidget(new Wt::WText(Wt::WString::tr("DeviceType")));
		table->elementAt(row++, 1)->addWidget(new Wt::WText(Wt::WString(string_value, Wt::UTF8)));
	}

	if (EPHIDGET_OK == CPhidget_getDeviceLabel(handle, &string_value))
	{
		table->elementAt(row, 0)->addWidget(new Wt::WText(Wt::WString::tr("DeviceLabel")));
		table->elementAt(row++, 1)->addWidget(new Wt::WText(Wt::WString(string_value, Wt::UTF8)));
	}

	return tab_container;
}
Esempio n. 11
0
void ioPhidget::display_generic_properties(CPhidgetHandle phid)
{
    const char *deviceptr;
    CPhidget_getDeviceType(phid, &deviceptr);
    CPhidget_getSerialNumber(phid, &serialNumber);
    CPhidget_getDeviceVersion(phid, &version);
    
    printf("%s\n", deviceptr);
    printf("Version: %8d SerialNumber: %10d\n", version, serialNumber);
    return;
}
Esempio n. 12
0
int gotDetach(CPhidgetHandle phid, void *ptr) {
	char *id;
	int serial, version;
	
	//print out some info  
	CPhidget_getSerialNumber(phid, &serial);
  	CPhidget_getDeviceVersion(phid, &version);
	CPhidget_getDeviceName((CPhidgetHandle)phid,(const char **)&id);
	printf("Device Removed: %s, Serial: %d, Version: %d\n",id,serial,version);
	
	return 0;
}
Esempio n. 13
0
int gotAttach(CPhidgetHandle phid, void *ptr) {
	const char *id, *label;
	int serial, version;
	
	//print out some info
	CPhidget_getDeviceLabel(phid, &label);
	CPhidget_getSerialNumber(phid, &serial);
  	CPhidget_getDeviceVersion(phid, &version);
	CPhidget_getDeviceName(phid, &id);
	printf("Device Added: %s, Serial: %d, Version: %d Label: %s\n",id,serial,version,label);
	
	return 0;
}
Esempio n. 14
0
JNIEXPORT jint JNICALL
Java_com_phidgets_Phidget_getDeviceVersion(JNIEnv *env, jobject obj)
{
	CPhidgetHandle h = (CPhidgetHandle)(uintptr_t)(*env)->GetLongField(env,
	    obj, handle_fid);
	int error;
	int ver;
	
	if ((error = CPhidget_getDeviceVersion(h, &ver)))
		PH_THROW(error);

	return ver;
}
Esempio n. 15
0
void display_generic_properties(CPhidgetHandle phid)
{
	int sernum, version;
	const char *deviceptr, *label;
	CPhidget_getDeviceType(phid, &deviceptr);
	CPhidget_getSerialNumber(phid, &sernum);
	CPhidget_getDeviceVersion(phid, &version);
	CPhidget_getDeviceLabel(phid, &label);

	printf("%s\n", deviceptr);
	printf("Version: %8d SerialNumber: %10d\n", version, sernum);
	printf("Label: %s\n", label);
	return;
}
Esempio n. 16
0
int display_properties(CPhidgetHandle phid)
{
	int serialNo, version;
	const char* ptr;
	
	CPhidget_getDeviceType(phid, &ptr);
	CPhidget_getSerialNumber(phid, &serialNo);
	CPhidget_getDeviceVersion(phid, &version);

	printf("%s\n", ptr);
	printf("Serial Number: %10d\nVersion: %8d\n", serialNo, version);

	return 0;
}
Esempio n. 17
0
	/** 
	  * Prints info about this motor
	  */
	void PhidgetLEDController::displayProperties()
	{
		int serialNo, version, numLED;
		const char* ptr;

		CPhidget_getDeviceType(getPhidgetHandle(), &ptr);
		CPhidget_getSerialNumber(getPhidgetHandle(), &serialNo);
		CPhidget_getDeviceVersion(getPhidgetHandle(), &version);
		CPhidgetLED_getLEDCount(m_LEDControl, &numLED);

		printf("%s\n", ptr);
		printf("Serial Number: %10d\nVersion: %8d\n", serialNo, version);
		printf("# LEDs: %d\n", numLED);
	}
Esempio n. 18
0
//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 display_properties(CPhidgetServoHandle phid)
{
	int serialNo, version, numMotors;
	const char* ptr;

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

	CPhidgetServo_getMotorCount (phid, &numMotors);

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

	return 0;
}
//Display the properties of the attached phidget to the screen.  We will be displaying the name, serial number and version of the attached device.
//We will also display the total number of available LEDs
int display_properties(CPhidgetLEDHandle phid)
{
	int serialNo, version, numLED;
	const char* ptr;

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

	printf("%s\n", ptr);
	printf("Serial Number: %10d\nVersion: %8d\n", serialNo, version);
	printf("# LEDs: %d\n", numLED);

	return 0;
}
Esempio n. 20
0
//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;
}
//Display the properties of the attached phidget to the screen.  
//We will be displaying the name, serial number, version of the attached device and number of Axes on the accelerometer.
int display_properties(CPhidgetHandle phid)
{
	int serialNo, version;
	const char* ptr;
	int numAxes;

	CPhidget_getDeviceType(phid, &ptr);
	CPhidget_getSerialNumber(phid, &serialNo);
	CPhidget_getDeviceVersion(phid, &version);
	CPhidgetAccelerometer_getAxisCount((CPhidgetAccelerometerHandle)phid, &numAxes);

	printf("%s\n", ptr);
	printf("Serial Number: %10d\nVersion: %8d\n", serialNo, version);
	printf("Number of Axes: %i\n", numAxes);

	return 0;
}
Esempio n. 22
0
//Display the properties of the attached phidget to the screen.  We will be displaying the name, serial number and version of the attached device.
//Will also display the number of inputs and encoders on this device
int display_properties(CPhidgetEncoderHandle phid)
{
	int serialNo, version, num_inputs, num_encoders;
	const char* ptr;

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

	CPhidgetEncoder_getInputCount(phid, &num_inputs);
	CPhidgetEncoder_getEncoderCount(phid, &num_encoders);

	printf("%s\n", ptr);
	printf("Serial Number: %10d\nVersion: %8d\n", serialNo, version);
	printf("Num Encoders: %d\nNum Inputs: %d\n", num_encoders, num_inputs);

	return 0;
}
Esempio n. 23
0
	/** 
	  * Prints info about this controller
	  */
	void PhidgetAnalogOutController::displayProperties()
	{
		int serialNo, version, numAnalog;
		double max, min;
		const char* ptr;

		CPhidget_getDeviceType(getPhidgetHandle(), &ptr);
		CPhidget_getSerialNumber(getPhidgetHandle(), &serialNo);
		CPhidget_getDeviceVersion(getPhidgetHandle(), &version);
		CPhidgetAnalog_getOutputCount(m_analogOut, &numAnalog);
		CPhidgetAnalog_getVoltageMax(m_analogOut, 0, &max);
		CPhidgetAnalog_getVoltageMin(m_analogOut, 0, &min);

		printf("%s\n", ptr);
		printf("Serial Number: %10d\nVersion: %8d\n", serialNo, version);
		printf("# Analog Outputs: %d\n", numAnalog);
		printf("Output range: -%0.1lfV - %0.1lfV\n",min,max);
	}
Esempio n. 24
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 );
}
Esempio n. 25
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;
}
Esempio n. 26
0
//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 display_properties(CPhidgetPHSensorHandle phid)
{
	int serialNo, version;
	double trigger, potential;
	const char* ptr;

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

	CPhidgetPHSensor_getPHChangeTrigger(phid, &trigger);
	CPhidgetPHSensor_getPotential(phid, &potential);

	printf("%s\n", ptr);
	printf("Serial Number: %10d\nVersion: %8d\n", serialNo, version);
	printf("Trigger Sensitivity: %f\nPotential: %f\n", trigger, potential);

	return 0;
}
int display_properties(CPhidgetRFIDHandle phid)
{
    int serialNo, version, numOutputs, antennaOn, LEDOn;
    const char* ptr;

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

    CPhidgetRFID_getOutputCount (phid, &numOutputs);
    CPhidgetRFID_getAntennaOn (phid, &antennaOn);
    CPhidgetRFID_getLEDOn (phid, &LEDOn);

    ROS_INFO("%s\n", ptr);
    ROS_INFO("Serial Number: %10d\nVersion: %8d\n", serialNo, version);
    ROS_INFO("# Outputs: %d\n\n", numOutputs);
    ROS_INFO("Antenna Status: %d\nOnboard LED Status: %d\n", antennaOn, LEDOn);

    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;
}
//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 display_properties(CPhidgetTemperatureSensorHandle phid)
{
	int serialNo, version, numInputs, i;
	double value;
	const char* ptr;

	double min, max;

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

	CPhidgetTemperatureSensor_getTemperatureInputCount (phid, &numInputs);
	

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

	for(i = 0; i < numInputs; i++)
	{
		CPhidgetTemperatureSensor_getTemperatureChangeTrigger (phid, i, &value);
		CPhidgetTemperatureSensor_getTemperatureMax(phid, i, &max);
		CPhidgetTemperatureSensor_getTemperatureMin(phid, i, &min);
		printf("Temperature Input #: %d > sensitivity: %f Max: %0.0f, Min: %0.0f\n", i, value, max, min);
	}

	CPhidgetTemperatureSensor_getPotentialMax(phid, 0, &max);
	CPhidgetTemperatureSensor_getPotentialMin(phid, 0, &min);
	printf("Potential Max: %0.3f, Min: %0.3f\n", max, min);

	CPhidgetTemperatureSensor_getAmbientTemperatureMax(phid, &max);
	CPhidgetTemperatureSensor_getAmbientTemperatureMin(phid, &min);
	printf("Ambient Sensor Max: %0.0f, Min: %0.0f\n", max, min);

	return 0;
}