/** * 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); }
//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; }
/** * Releases the connection with the motor and resources */ void PhidgetLEDController::end() { // If it has already been init, do nothing if ( !m_isValid || !m_LEDControl ) { LOG( "PhidgetLEDController::end(). This LED controller was released already --> Doing nothing" ); return; } // Turn off all the LEDs int numLED = 0; CPhidgetLED_getLEDCount(m_LEDControl, &numLED); for( int i = 0; i < numLED; ++i ) { setBrightness(i, 0); } PhidgetControllerBase::end(); }