libphidget-cvs-commits Mailing List for Phidget Library
Status: Alpha
Brought to you by:
jstrohm
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(66) |
Oct
|
Nov
|
Dec
(73) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(9) |
Jul
(5) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
From: Jack S. <js...@us...> - 2003-12-07 02:15:08
|
Update of /cvsroot/libphidget/libphidget/src/libphidget In directory sc8-pr-cvs1:/tmp/cvs-serv18876/src/libphidget Modified Files: phidget.c Log Message: Added patch from Loic Dachary - Thanks! Supports PhidgetTextLCD idVendor 0x06c2 idProduct 0x0052 Supports PhidgetServer idVendor 0x0925 idProduct 0x8101 Index: phidget.c =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/libphidget/phidget.c,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** phidget.c 15 Aug 2003 02:43:29 -0000 1.36 --- phidget.c 7 Dec 2003 02:15:05 -0000 1.37 *************** *** 34,37 **** --- 34,131 ---- + /* + * Phidgets Protocol specific values for LCD screens + */ + #define PHIDGET_LCD_PROTOCOL_ESCAPE 0x00 /* If next value in buffer is 0x01 or 0x02, + it will not be interpreted as a + CONTROL_MODE or DATA_MODE switch. */ + #define PHIDGET_LCD_PROTOCOL_CONTROL_MODE 0x01 /* The next values in the buffer are + interpreted according to the + instruction set of the LCD screen + (HD44780 for instance). */ + #define PHIDGET_LCD_PROTOCOL_DATA_MODE 0x02 /* The next values in the buffer are + interpreted as characters to be + written on the screen. */ + #define PHIDGET_LCD_PROTOCOL_BUFFER_SIZE 8 /* Each USB packet must contain exactly + 8 bytes. */ + #define PHIDGET_LCD_PROTOCOL_LENGTH_INDEX 7 /* The number of valid bytes in the packet + must be located in the 7th byte of the + packet. */ + /* + * phidgetDevice->type->vendorID == 0x06C2 && phidgetDevice->type->productID == 0x0052 + * http://www.eio.com/hd44780.pdf page 191 + * http://www.doc.ic.ac.uk/~ih/doc/lcd/pc_example/ + * + * Constants for register values. + */ + + /* + * Turning the backlight of the HD44780 screen is done in a way that + * does not match the LCD_PROTOCOL above. Light is controled by + * black magic ;-) + */ + #define PHIDGET_HD44780_BYTE_0_BACKLIGHT_TURN_ON 0x01 + #define PHIDGET_HD44780_BYTE_7_BACKLIGHT_TURN_ON 0x11 + #define PHIDGET_HD44780_BYTE_0_BACKLIGHT_TURN_OFF 0x00 + #define PHIDGET_HD44780_BYTE_7_BACKLIGHT_TURN_OFF 0x11 + + #define HD44780_CHARACTERS_PER_LINE 20 /* One or two 20 characters lines. */ + + // HD44780 Instruction Set DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0 + // ======================= === === === === === === === === + #define HD44780_CLEAR_DISPLAY 0x01 // 0 0 0 0 0 0 0 1 + #define HD44780_RETURN_HOME 0x02 // 0 0 0 0 0 0 1 * + #define HD44780_SET_ENTRY_MODE 0x04 // 0 0 0 0 0 1 I/D S + #define HD44780_SET_DISPLAY 0x08 // 0 0 0 0 1 D C B + #define HD44780_SET_CURSOR_AND_DISPLAY_SHIFT 0x10 // 0 0 0 1 S/C R/L * * + #define HD44780_SET_FUNCTION 0x20 // 0 0 1 DL N F * * + #define HD44780_SET_CGRAM_ADDRESS 0x40 // 0 1 A A A A A A + #define HD44780_SET_DDRAM_ADDRESS 0x80 // 1 A A A A A A A + + // HD44780 Parameters + // ================== + // N.B. explicit values for EVERY corresponding parameter + // ==== MUST be passed each time any instruction is used + + // Set_Entry_Mode + // ============== + #define HD44780_DECREMENT_ADDRESS 0x00 // . . . . . . 0 . + #define HD44780_INCREMENT_ADDRESS 0x02 // . . . . . . 1 . + + #define HD44780_SHIFT_DISPLAY_OFF 0x00 // . . . . . . . 0 + #define HD44780_SHIFT_DISPLAY_ON 0x01 // . . . . . . . 1 + + // Set_Display + // =========== + #define HD44780_DISPLAY_OFF 0x00 // . . . . . 0 . . + #define HD44780_DISPLAY_ON 0x04 // . . . . . 1 . . + + #define HD44780_CURSOR_OFF 0x00 // . . . . . . 0 . + #define HD44780_CURSOR_ON 0x02 // . . . . . . 1 . + + #define HD44780_BLINK_OFF 0x00 // . . . . . . . 0 + #define HD44780_BLINK_ON 0x01 // . . . . . . . 1 + + // Set_Cursor_and_Display_Shift + // ============================ + #define HD44780_CURSOR 0x00 // . . . . 0 . . . + #define HD44780_DISPLAY_AND_CURSOR 0x08 // . . . . 1 . . . + + #define HD44780_LEFT 0x00 // . . . . . 0 . . + #define HD44780_RIGHT 0x04 // . . . . . 1 . . + + // Set_Function + // ============ + #define HD44780_DATA_LENGTH_4 0x00 // . . . 0 . . . . + #define HD44780_DATA_LENGTH_8 0x10 // . . . 1 . . . . + + #define HD44780_ONE_DISPLAY_LINE 0x00 // . . . . 0 . . . + #define HD44780_TWO_DISPLAY_LINES 0x08 // . . . . 1 . . . + + #define HD44780_FONT_5X7 0x00 // . . . . . 0 . . + #define HD44780_FONT_5X10 0x04 // . . . . . 1 . . + + #define HD44780_LINE2_OFFSET 0x40 + /** * Phidget description informatioin. \a deviceClass is specially useful in determining what type of phidget this is. *************** *** 939,942 **** --- 1033,1037 ---- _registerDeviceType("QuadServo .1 Degree", 0x06C2, 0x0038, LP_QUAD_SERVO); _registerDeviceType("UniServo .1 Degree", 0x06C2, 0x0039, LP_UNI_SERVO); + _registerDeviceType("UniServo .1 Degree", 0x0925, 0x8101, LP_UNI_SERVO); _registerDeviceType("Interface Kit 4/8/8", 0x0925, 0x8201, LP_INTERFACE_KIT_488); _registerDeviceType("Interface Kit 4/8/8", 0x06C2, 0x0040, LP_INTERFACE_KIT_488); *************** *** 945,948 **** --- 1040,1047 ---- _registerDeviceType("Phidget LCD", 0x06C2, 0x0041, LP_INTERFACE_KIT_880); _registerDeviceType("PhidgetTextLCD ECMA1010 Ver 1.0", 0x06C2, 0x0050,LP_TEXT_LCD); + /* Specifications for the line below at + http://www.eio.com/hd44780.pdf + http://home.iae.nl/users/pouweha/lcd/lcd.shtml */ + _registerDeviceType("PhidgetTextLCD", 0x06C2, 0x0052,LP_TEXT_LCD); _registerDeviceType("RFID VID/PID", 0x06C2, 0x0030, LP_RFID); _registerDeviceType("8-AdvancedServo", 0x06C2, 0x003B, LP_8WAY_SERVO); *************** *** 1283,1289 **** enum ELPError phidgetSingleServo(struct phidget *phidgetDevice, float percent) { - int _min=230,_max=(int) (180 * 10.6f + 230)+_min; - int pulse; char buffer[6] = { 0 }; DBG("phidgetSingleServo"); --- 1382,1387 ---- enum ELPError phidgetSingleServo(struct phidget *phidgetDevice, float percent) { char buffer[6] = { 0 }; + int buffer_size; DBG("phidgetSingleServo"); *************** *** 1298,1316 **** return (_error(LPE_WRONG_PHIDGET_CLASS_TYPE)); ! //pulse = (int) (((percent) * 180) * 10.6f + 230); ! if (phidgetDevice->extraData!=NULL) ! { ! int *temp=(int *)phidgetDevice->extraData; ! _min=temp[0]; ! _max=temp[1]; ! } ! //pulse = (int) (((percent) * 180) * 10.6f + 230); ! pulse=(percent*(_max-_min))+_min; ! buffer[0] = pulse % 256; ! buffer[1] = (pulse / 256); ! return (phidgetWrite(phidgetDevice, buffer, sizeof(buffer))); } --- 1396,1434 ---- return (_error(LPE_WRONG_PHIDGET_CLASS_TYPE)); ! if(phidgetDevice->type->vendorID == 0x0925 && phidgetDevice->type->productID == 0x8101) { ! /* ! * idVendor 0x0925 ! * idProduct 0x8101 ! * bcdDevice 0.02 ! * iManufacturer 1 GLAB Chester ! * iProduct 2 PhidgetServo ! * http://sourceforge.net/docman/display_doc.php?docid=12651&group_id=60607 ! */ ! buffer[0] = 0; /* Index of servo : always 0 on single servo */ ! buffer[1] = (int)(percent * 255); /* Semantic is unclear. */ ! ! buffer_size = 2; ! } else { ! int _min=230,_max=(int) (180 * 10.6f + 230)+_min; ! int pulse; ! //pulse = (int) (((percent) * 180) * 10.6f + 230); ! if (phidgetDevice->extraData!=NULL) ! { ! int *temp=(int *)phidgetDevice->extraData; ! _min=temp[0]; ! _max=temp[1]; ! } ! //pulse = (int) (((percent) * 180) * 10.6f + 230); ! pulse=(percent*(_max-_min))+_min; ! buffer[0] = pulse % 256; ! buffer[1] = (pulse / 256); ! ! buffer_size = 6; ! } ! ! return (phidgetWrite(phidgetDevice, buffer, buffer_size)); } *************** *** 1835,1842 **** enum ELPError phidgetTextLCDClear(struct phidget *phidgetDevice) { ! phidgetTextLCDWrite(phidgetDevice,0,0," "); ! phidgetTextLCDWrite(phidgetDevice,1,0," "); ! phidgetTextLCDWrite(phidgetDevice,2,0," "); ! phidgetTextLCDWrite(phidgetDevice,3,0," "); } --- 1953,1963 ---- enum ELPError phidgetTextLCDClear(struct phidget *phidgetDevice) { ! phidgetTextLCDWrite(phidgetDevice,0,0," "); ! phidgetTextLCDWrite(phidgetDevice,1,0," "); ! if(!(phidgetDevice->type->vendorID == 0x06C2 && phidgetDevice->type->productID == 0x0052)) { ! ! phidgetTextLCDWrite(phidgetDevice,2,0," "); ! phidgetTextLCDWrite(phidgetDevice,3,0," "); ! } } *************** *** 1846,1856 **** enum ELPError phidgetTextLCDOn(struct phidget *phidgetDevice) { ! char buffer[8]; ! buffer[0] = 0x69; // 0: 0 1 1 0 1 0 0 1 <- System Set, 4 lines, Use CGRAM ! buffer[1] = 0x31; // 0: 0 0 1 1 0 0 0 1 <- Display ON/OFF, Display ON ! buffer[2] = 0x42; // 0: 0 1 0 0 0 0 1 0 <- Power Save, Oscillator Circuit ON ! buffer[7] = 3; ! return(phidgetWrite(phidgetDevice,buffer,8)); } --- 1967,1993 ---- enum ELPError phidgetTextLCDOn(struct phidget *phidgetDevice) { ! char buffer[PHIDGET_LCD_PROTOCOL_BUFFER_SIZE] = { 0 }; ! int i = 0; ! if(phidgetDevice->type->vendorID == 0x06C2 && phidgetDevice->type->productID == 0x0052) { ! buffer[i++] = HD44780_SET_FUNCTION | HD44780_DATA_LENGTH_8 | HD44780_TWO_DISPLAY_LINES | HD44780_FONT_5X7; ! buffer[i++] = PHIDGET_LCD_PROTOCOL_ESCAPE; ! buffer[i++] = HD44780_CLEAR_DISPLAY; ! buffer[i++] = HD44780_SET_DISPLAY | HD44780_DISPLAY_ON | HD44780_CURSOR_ON | HD44780_BLINK_ON; ! buffer[PHIDGET_LCD_PROTOCOL_LENGTH_INDEX] = i; ! ! phidgetWrite(phidgetDevice,buffer,PHIDGET_LCD_PROTOCOL_BUFFER_SIZE); ! ! memset(buffer, '\0', PHIDGET_LCD_PROTOCOL_BUFFER_SIZE); ! buffer[0] = PHIDGET_HD44780_BYTE_0_BACKLIGHT_TURN_ON; ! buffer[7] = PHIDGET_HD44780_BYTE_7_BACKLIGHT_TURN_ON; ! } else { ! buffer[i++] = 0x69; // 0: 0 1 1 0 1 0 0 1 <- System Set, 4 lines, Use CGRAM ! buffer[i++] = 0x31; // 0: 0 0 1 1 0 0 0 1 <- Display ON/OFF, Display ON ! buffer[i++] = 0x42; // 0: 0 1 0 0 0 0 1 0 <- Power Save, Oscillator Circuit ON ! buffer[7] = 3; ! } ! ! return(phidgetWrite(phidgetDevice,buffer,PHIDGET_LCD_PROTOCOL_BUFFER_SIZE)); } *************** *** 1860,1869 **** enum ELPError phidgetTextLCDOff(struct phidget *phidgetDevice) { ! char buffer[8]; ! buffer[0] = 0x30; // 0: 0 0 1 1 0 0 0 0 <- Display ON/OFF, Display ON ! buffer[1] = 0x40; // 0: 0 1 0 0 0 0 0 0 <- Power Save, Oscillator Circuit ON ! buffer[7] = 2; ! return(phidgetWrite(phidgetDevice,buffer,8)); } --- 1997,2017 ---- enum ELPError phidgetTextLCDOff(struct phidget *phidgetDevice) { ! char buffer[PHIDGET_LCD_PROTOCOL_BUFFER_SIZE] = { 0 }; ! int i = 0; ! if(phidgetDevice->type->vendorID == 0x06C2 && phidgetDevice->type->productID == 0x0052) { ! buffer[0] = PHIDGET_HD44780_BYTE_0_BACKLIGHT_TURN_OFF; ! buffer[7] = PHIDGET_HD44780_BYTE_7_BACKLIGHT_TURN_OFF; ! phidgetWrite(phidgetDevice,buffer,PHIDGET_LCD_PROTOCOL_BUFFER_SIZE); ! memset(buffer, '\0', PHIDGET_LCD_PROTOCOL_BUFFER_SIZE); ! ! buffer[i++] = HD44780_SET_DISPLAY | HD44780_DISPLAY_OFF; ! } else { ! buffer[i++] = 0x30; // 0: 0 0 1 1 0 0 0 0 <- Display ON/OFF, Display ON ! buffer[i++] = 0x40; // 0: 0 1 0 0 0 0 0 0 <- Power Save, Oscillator Circuit ON ! } ! buffer[PHIDGET_LCD_PROTOCOL_LENGTH_INDEX] = i; ! ! return(phidgetWrite(phidgetDevice,buffer,PHIDGET_LCD_PROTOCOL_BUFFER_SIZE)); } *************** *** 1879,1898 **** int pos=0,t,len,tc; unsigned char temp[256],buffer[10]; ! //temp[pos++] = 0x69; // 0: 0 1 1 0 1 0 0 1 <- System Set, 4 lines, Use CGRAM ! //temp[pos++] = 0x31; // 0: 0 0 1 1 0 0 0 1 <- Display ON/OFF, Display ON ! //temp[pos++] = 0x42; // 0: 0 1 0 0 0 0 1 0 <- Power Save, Oscillator Circuit ON ! temp[pos++] = 0x57; // 0: 0 1 0 1 0 1 1 1 <- RAM Address set to 010111 (23) ! temp[pos++] = 0xB0; // Set the address pointer ! temp[pos++] = 0x30 + row * 0x10 + 0x80+col; // set position we write to ! temp[pos++] = 0x02; // Data mode // Write the string len=strlen(str); ! if (len>12) len=12; for (t=0;t<len;t++) temp[pos++]=str[t]; ! temp[pos++] = 0x01; // back to command mode tc=0; --- 2027,2054 ---- int pos=0,t,len,tc; unsigned char temp[256],buffer[10]; + int max_len = 0; ! if(phidgetDevice->type->vendorID == 0x06C2 && phidgetDevice->type->productID == 0x0052) { ! temp[pos++] = HD44780_SET_DDRAM_ADDRESS | (((row % 2) - 1) * HD44780_LINE2_OFFSET); ! temp[pos++] = PHIDGET_LCD_PROTOCOL_DATA_MODE; ! max_len = HD44780_CHARACTERS_PER_LINE; ! } else { ! //temp[pos++] = 0x69; // 0: 0 1 1 0 1 0 0 1 <- System Set, 4 lines, Use CGRAM ! //temp[pos++] = 0x31; // 0: 0 0 1 1 0 0 0 1 <- Display ON/OFF, Display ON ! //temp[pos++] = 0x42; // 0: 0 1 0 0 0 0 1 0 <- Power Save, Oscillator Circuit ON ! temp[pos++] = 0x57; // 0: 0 1 0 1 0 1 1 1 <- RAM Address set to 010111 (23) ! temp[pos++] = 0xB0; // Set the address pointer ! temp[pos++] = 0x30 + row * 0x10 + 0x80+col; // set position we write to ! temp[pos++] = 0x02; // Data mode ! max_len = 12; ! } // Write the string len=strlen(str); ! if (len>max_len) len=max_len; for (t=0;t<len;t++) temp[pos++]=str[t]; ! temp[pos++] = PHIDGET_LCD_PROTOCOL_CONTROL_MODE; tc=0; *************** *** 1900,1907 **** { buffer[tc++]=temp[t]; ! if (tc==7) { ! buffer[7]=7; ! phidgetWrite(phidgetDevice,buffer,8); tc=0; } --- 2056,2063 ---- { buffer[tc++]=temp[t]; ! if (tc==PHIDGET_LCD_PROTOCOL_LENGTH_INDEX) { ! buffer[PHIDGET_LCD_PROTOCOL_LENGTH_INDEX]=tc; ! phidgetWrite(phidgetDevice,buffer,PHIDGET_LCD_PROTOCOL_BUFFER_SIZE); tc=0; } *************** *** 1909,1914 **** if (tc!=0) { ! buffer[7]=tc; ! phidgetWrite(phidgetDevice,buffer,8); } --- 2065,2070 ---- if (tc!=0) { ! buffer[PHIDGET_LCD_PROTOCOL_LENGTH_INDEX]=tc; ! phidgetWrite(phidgetDevice,buffer,PHIDGET_LCD_PROTOCOL_BUFFER_SIZE); } |
From: Jack S. <js...@us...> - 2003-12-07 02:15:08
|
Update of /cvsroot/libphidget/libphidget In directory sc8-pr-cvs1:/tmp/cvs-serv18876 Modified Files: ChangeLog Log Message: Added patch from Loic Dachary - Thanks! Supports PhidgetTextLCD idVendor 0x06c2 idProduct 0x0052 Supports PhidgetServer idVendor 0x0925 idProduct 0x8101 Index: ChangeLog =================================================================== RCS file: /cvsroot/libphidget/libphidget/ChangeLog,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ChangeLog 7 Sep 2002 20:12:29 -0000 1.2 --- ChangeLog 7 Dec 2003 02:15:05 -0000 1.3 *************** *** 0 **** --- 1,64 ---- + Thu Oct 16 19:49:27 2003 Loic Dachary <lo...@gn...> + + * src/libphidget/phidget.c (phidgetTextLCD*): Add support for 0x06C2 / 0x0052 + + Thu Oct 16 14:01:50 2003 Loic Dachary <lo...@gn...> + + * src/libphidget/phidget.c (phidgetSingleServo): Add support for 0x0925 / 0x8101 + + Thu Oct 16 19:49:27 2003 Loic Dachary <lo...@gn...> + + * src/libphidget/phidget.c (phidgetTextLCD*): Add support for 0x06C2 / 0x0052 + + Thu Oct 16 14:01:50 2003 Loic Dachary <lo...@gn...> + + * src/libphidget/phidget.c (phidgetSingleServo): Add support for 0x0925 / 0x8101 + + Thu Oct 16 19:49:27 2003 Loic Dachary <lo...@gn...> + + * src/libphidget/phidget.c (phidgetTextLCD*): Add support for 0x06C2 / 0x0052 + + Thu Oct 16 14:01:50 2003 Loic Dachary <lo...@gn...> + + * src/libphidget/phidget.c (phidgetSingleServo): Add support for 0x0925 / 0x8101 + + Thu Oct 16 19:49:27 2003 Loic Dachary <lo...@gn...> + + * src/libphidget/phidget.c (phidgetTextLCD*): Add support for 0x06C2 / 0x0052 + + Thu Oct 16 14:01:50 2003 Loic Dachary <lo...@gn...> + + * src/libphidget/phidget.c (phidgetSingleServo): Add support for 0x0925 / 0x8101 + + Thu Oct 16 19:49:27 2003 Loic Dachary <lo...@gn...> + + * src/libphidget/phidget.c (phidgetTextLCD*): Add support for 0x06C2 / 0x0052 + + Thu Oct 16 14:01:50 2003 Loic Dachary <lo...@gn...> + + * src/libphidget/phidget.c (phidgetSingleServo): Add support for 0x0925 / 0x8101 + + Thu Oct 16 19:49:27 2003 Loic Dachary <lo...@gn...> + + * src/libphidget/phidget.c (phidgetTextLCD*): Add support for 0x06C2 / 0x0052 + + Thu Oct 16 14:01:50 2003 Loic Dachary <lo...@gn...> + + * src/libphidget/phidget.c (phidgetSingleServo): Add support for 0x0925 / 0x8101 + + Thu Oct 16 19:49:27 2003 Loic Dachary <lo...@gn...> + + * src/libphidget/phidget.c (phidgetTextLCD*): Add support for 0x06C2 / 0x0052 + + Thu Oct 16 14:01:50 2003 Loic Dachary <lo...@gn...> + + * src/libphidget/phidget.c (phidgetSingleServo): Add support for 0x0925 / 0x8101 + + Thu Oct 16 19:49:27 2003 Loic Dachary <lo...@gn...> + + * src/libphidget/phidget.c (phidgetTextLCD*): Add support for 0x06C2 / 0x0052 + + Thu Oct 16 14:01:50 2003 Loic Dachary <lo...@gn...> + + * src/libphidget/phidget.c (phidgetSingleServo): Add support for 0x0925 / 0x8101 + |
From: Jack S. <js...@us...> - 2003-08-15 03:06:16
|
Update of /cvsroot/libphidget/libphidget/src/libphidget In directory sc8-pr-cvs1:/tmp/cvs-serv22528/libphidget Modified Files: phidget.c phidget.h Log Message: Added initial support for RFID phidget Index: phidget.c =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/libphidget/phidget.c,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** phidget.c 8 Jul 2003 02:24:11 -0000 1.35 --- phidget.c 15 Aug 2003 02:43:29 -0000 1.36 *************** *** 945,949 **** _registerDeviceType("Phidget LCD", 0x06C2, 0x0041, LP_INTERFACE_KIT_880); _registerDeviceType("PhidgetTextLCD ECMA1010 Ver 1.0", 0x06C2, 0x0050,LP_TEXT_LCD); ! //_registerDeviceType("RFID VID/PID", 0x06C2, 0x0030, LP_OTHER); _registerDeviceType("8-AdvancedServo", 0x06C2, 0x003B, LP_8WAY_SERVO); //_registerDeviceType("Interface Kit 32-32-0", 0x06C2, 0x0042, LP_INTERFACE_KIT); --- 945,949 ---- _registerDeviceType("Phidget LCD", 0x06C2, 0x0041, LP_INTERFACE_KIT_880); _registerDeviceType("PhidgetTextLCD ECMA1010 Ver 1.0", 0x06C2, 0x0050,LP_TEXT_LCD); ! _registerDeviceType("RFID VID/PID", 0x06C2, 0x0030, LP_RFID); _registerDeviceType("8-AdvancedServo", 0x06C2, 0x003B, LP_8WAY_SERVO); //_registerDeviceType("Interface Kit 32-32-0", 0x06C2, 0x0042, LP_INTERFACE_KIT); *************** *** 1915,1918 **** --- 1915,1941 ---- return (_error(LPE_NONE)); } + + + /** + * Checks for RFID's + */ + enum ELPError phidgetRFID(struct phidget *phidgetDevice, struct RFID *rfid) + { + char buffer[7]; + enum ELPError err; + + err=phidgetRead(phidgetDevice,buffer,sizeof(buffer)); + if (err!=LPE_NONE) + return(_error(err)); + + rfid->bytes[0]=buffer[1]; + rfid->bytes[1]=buffer[2]; + rfid->bytes[2]=buffer[3]; + rfid->bytes[3]=buffer[4]; + rfid->bytes[4]=buffer[5]; + + return (_error(LPE_NONE)); + } + /** Index: phidget.h =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/libphidget/phidget.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** phidget.h 30 Jun 2003 02:49:16 -0000 1.23 --- phidget.h 15 Aug 2003 02:43:29 -0000 1.24 *************** *** 128,131 **** --- 128,139 ---- }; + /** + * Structure to store an RFID + */ + struct RFID + { + unsigned char bytes[5]; + }; + #ifdef __cplusplus extern "C" *************** *** 426,429 **** --- 434,445 ---- const char *phidgetErrorString( const enum ELPError err //!< The error number you want made human readable + ); + + /** + * Checks for RFID's, currently this blocks until an RFID is detected + */ + enum ELPError phidgetRFID( + struct phidget *phidgetDevice, //!< The phidget to read from + struct RFID *rfid //!< The RFID we detected ); |
From: Jack S. <js...@us...> - 2003-08-15 03:06:16
|
Update of /cvsroot/libphidget/libphidget/src/examples In directory sc8-pr-cvs1:/tmp/cvs-serv22528/examples Modified Files: phidget_c.c Log Message: Added initial support for RFID phidget Index: phidget_c.c =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/examples/phidget_c.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** phidget_c.c 8 Jul 2003 02:24:11 -0000 1.24 --- phidget_c.c 15 Aug 2003 02:43:29 -0000 1.25 *************** *** 28,31 **** --- 28,32 ---- int IKDIGITALWRITE=0; int IK880=0; + int RFID=0; int TEXTLCD=0; int POWER=0; *************** *** 76,79 **** --- 77,81 ---- printf(" TEXTLCD - test text lcd\n"); printf(" POWER - test power phidget\n"); + printf(" RFID - test RFID phidget\n"); *************** *** 96,99 **** --- 98,102 ---- if (strcmp(argv[1],"TEXTLCD")==0) TEXTLCD=1; if (strcmp(argv[1],"POWER")==0) POWER=1; + if (strcmp(argv[1],"RFID")==0) RFID=1; } *************** *** 341,344 **** --- 344,363 ---- else printf("Not a power phidget\n"); + + if (RFID) + { + while(1) + { + struct RFID rfid; + + if (phidgetRFID(dev,&rfid)==LPE_NONE) + printf("RFID: %02x:%02x:%02x:%02x:%02x\n",rfid.bytes[0],rfid.bytes[1],rfid.bytes[2],rfid.bytes[3],rfid.bytes[4]); + else + { + printf("error - %s\n",phidgetErrorString(phidgetLastError())); + return(9); + } + } + } // Close the phidget |
From: Jack S. <js...@us...> - 2003-07-08 02:24:14
|
Update of /cvsroot/libphidget/libphidget/src/libphidget In directory sc8-pr-cvs1:/tmp/cvs-serv17875/libphidget Modified Files: phidget.c Log Message: Added some code to support digital output on the 888 Index: phidget.c =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/libphidget/phidget.c,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** phidget.c 4 Jul 2003 22:38:46 -0000 1.34 --- phidget.c 8 Jul 2003 02:24:11 -0000 1.35 *************** *** 596,599 **** --- 596,608 ---- */ + // For the 888 let's allocate some space so that we can store it's digital out state + if (temp->type->deviceClass == LP_INTERFACE_KIT_888) + { + temp->extraDataSize = 1; + temp->extraData = malloc(temp->extraDataSize); + memset(temp->extraData,0,temp->extraDataSize); + } + + _usbDeviceList[_phidgetDeviceCount] = temp; *************** *** 1549,1552 **** --- 1558,1574 ---- char buffer[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + int ServoPosition=percent*180; + int MaxVelocity=maxvelocity*400; + int Acceleration=acceleration*2000; + + + buffer[0] = id; + buffer[1] = 0xff; + ((int *)(buffer+4))[0] = (int)((ServoPosition + 23) * 8109); + ((int *)(buffer+4))[1] = (int)((MaxVelocity / 50) * 8109); + ((int *)(buffer+4))[2] = (int)((Acceleration / 2500) * 8109); + + /* + // Kinda stopped working buffer[0]=id; // Which servo to control *************** *** 1571,1574 **** --- 1593,1597 ---- // Write the position, this seems to work. ((int *)(buffer+5))[0] = percent*16218; + */ *************** *** 1718,1727 **** char buffer[4]; ! // TODO - This doesn't work for the 888 yet, need to rework some internal data structures to get it working. ! ! buffer[0] = index+(value << 3); buffer[1] = 0; buffer[2] = 0; buffer[3] = 0; return(phidgetWrite(phidgetDevice,buffer,4)); } --- 1741,1766 ---- char buffer[4]; ! // Used by all formats buffer[1] = 0; buffer[2] = 0; buffer[3] = 0; + + if (phidgetDevice->type->deviceClass == LP_INTERFACE_KIT_888) + { + unsigned char *privateData=(unsigned char *)phidgetDevice->extraData; + + // 888 version, using the extra data buffer + if (value) + privateData[0] |= 1 << index; + else + privateData[0] &= ~(1 << index); + buffer[0] = privateData[0]; + } + else + { + // Everyone else + buffer[0] = index+(value << 3); + } + return(phidgetWrite(phidgetDevice,buffer,4)); } |
From: Jack S. <js...@us...> - 2003-07-08 02:24:14
|
Update of /cvsroot/libphidget/libphidget/src/examples In directory sc8-pr-cvs1:/tmp/cvs-serv17875/examples Modified Files: phidget_c.c Log Message: Added some code to support digital output on the 888 Index: phidget_c.c =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/examples/phidget_c.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** phidget_c.c 30 Jun 2003 02:53:27 -0000 1.23 --- phidget_c.c 8 Jul 2003 02:24:11 -0000 1.24 *************** *** 175,179 **** { for (i=0;i<8;i++) ! if (phidget8Servo (dev, i,k,.1,.1)<0) { printf("error - %s\n",phidgetErrorString(phidgetLastError())); --- 175,179 ---- { for (i=0;i<8;i++) ! if (phidget8Servo (dev, i,k,1,1)<0) { printf("error - %s\n",phidgetErrorString(phidgetLastError())); |
From: Jack S. <js...@us...> - 2003-07-04 22:38:49
|
Update of /cvsroot/libphidget/libphidget/src/libphidget In directory sc8-pr-cvs1:/tmp/cvs-serv19749/libphidget Modified Files: SoftPhidget.h phidget.c Log Message: Removed more DBG statements Index: SoftPhidget.h =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/libphidget/SoftPhidget.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SoftPhidget.h 30 Jun 2003 02:49:16 -0000 1.3 --- SoftPhidget.h 4 Jul 2003 22:38:46 -0000 1.4 *************** *** 174,180 **** 5,1,2,4,0,0,7,5,130,2,4,0,0,}; ! #define SOFT_SERVO8_SIZE 6975 ! const unsigned char SOFT_SERVO8_CODE[SOFT_SERVO8_SIZE] = {60, ! 27,8,2,0,14,2,15,223,0,0,0,0,0,2,16,154,117,129,137,120,137,118,0,216,252, 144,0,0,174,131,175,130,144,0,0,18,0,76,96,5,228,240,163,128,246,144,0,170,18,0, 85,144,0,174,18,0,85,144,0,178,18,0,115,144,0,184,18,0,115,117,208,0,18,16,165, --- 174,181 ---- 5,1,2,4,0,0,7,5,130,2,4,0,0,}; ! ! #define SOFT_SERVO8_SIZE 7343 ! const unsigned char SOFT_SERVO8_CODE[SOFT_SERVO8_SIZE] = { 172, ! 28,151,2,0,14,2,15,223,0,0,0,0,0,2,16,154,117,129,138,120,138,118,0,216,252, 144,0,0,174,131,175,130,144,0,0,18,0,76,96,5,228,240,163,128,246,144,0,170,18,0, 85,144,0,174,18,0,85,144,0,178,18,0,115,144,0,184,18,0,115,117,208,0,18,16,165, *************** *** 183,187 **** 2,147,254,116,3,147,255,116,4,147,248,116,5,147,245,130,136,131,18,0,76,112,1,34,228, 147,163,168,131,169,130,140,131,141,130,240,163,172,131,173,130,136,131,137,130,128,227,48,48,5, ! 124,138,138,5,124,0,0,5,124,5,124,0,0,5,124,5,124,128,254,228,195,159,255,228,158, 254,228,157,253,228,156,252,34,245,240,195,239,155,245,131,238,154,66,131,237,153,66,131,236,32, 240,6,100,128,200,100,128,200,152,130,241,48,242,5,69,131,112,1,211,48,243,1,179,228,51, --- 184,188 ---- 2,147,254,116,3,147,255,116,4,147,248,116,5,147,245,130,136,131,18,0,76,112,1,34,228, 147,163,168,131,169,130,140,131,141,130,240,163,172,131,173,130,136,131,137,130,128,227,48,48,5, ! 124,139,139,5,124,0,0,5,124,5,124,0,0,5,124,5,124,128,254,228,195,159,255,228,158, 254,228,157,253,228,156,252,34,245,240,195,239,155,245,131,238,154,66,131,237,153,66,131,236,32, 240,6,100,128,200,100,128,200,152,130,241,48,242,5,69,131,112,1,211,48,243,1,179,228,51, *************** *** 233,244 **** 248,226,252,8,226,253,8,226,254,8,226,128,195,192,224,143,240,164,43,251,229,240,58,255,208, 240,238,164,47,250,34,239,20,112,9,144,255,240,224,68,16,240,128,7,144,255,240,224,84,239, ! 240,34,120,71,166,7,239,195,148,4,64,1,34,120,71,230,120,97,246,34,144,255,240,224,84, 128,100,128,96,20,144,255,240,224,84,32,96,10,144,255,240,224,68,32,240,127,1,34,128,226, 127,0,34,144,255,240,224,84,8,100,8,96,20,144,255,240,224,84,32,96,10,144,255,240,224, 68,32,240,127,1,34,128,226,127,0,34,120,73,166,7,144,255,240,224,84,252,240,120,76,230, ! 8,70,112,3,127,0,34,120,97,230,20,112,14,120,75,230,195,51,68,1,144,255,243,240,2, ! 6,133,120,73,230,84,7,120,71,246,120,71,230,195,51,246,120,71,230,68,160,246,120,97,230, 100,2,112,33,120,74,230,211,148,0,64,25,120,74,230,126,0,84,7,120,72,246,120,72,230, ! 195,51,246,120,72,134,7,120,71,230,79,246,120,71,230,144,255,243,240,120,97,230,100,3,112, 18,120,74,230,126,0,144,255,241,240,18,5,196,239,96,3,127,1,34,120,75,230,84,255,144, 255,241,240,18,5,196,239,96,3,127,1,34,120,71,230,68,1,144,255,243,240,144,255,241,228, --- 234,245 ---- 248,226,252,8,226,253,8,226,254,8,226,128,195,192,224,143,240,164,43,251,229,240,58,255,208, 240,238,164,47,250,34,239,20,112,9,144,255,240,224,68,16,240,128,7,144,255,240,224,84,239, ! 240,34,120,71,166,7,239,195,148,4,64,1,34,120,71,230,120,98,246,34,144,255,240,224,84, 128,100,128,96,20,144,255,240,224,84,32,96,10,144,255,240,224,68,32,240,127,1,34,128,226, 127,0,34,144,255,240,224,84,8,100,8,96,20,144,255,240,224,84,32,96,10,144,255,240,224, 68,32,240,127,1,34,128,226,127,0,34,120,73,166,7,144,255,240,224,84,252,240,120,76,230, ! 8,70,112,3,127,0,34,120,98,230,20,112,14,120,75,230,195,51,68,1,144,255,243,240,2, ! 6,133,120,73,230,84,7,120,71,246,120,71,230,195,51,246,120,71,230,68,160,246,120,98,230, 100,2,112,33,120,74,230,211,148,0,64,25,120,74,230,126,0,84,7,120,72,246,120,72,230, ! 195,51,246,120,72,134,7,120,71,230,79,246,120,71,230,144,255,243,240,120,98,230,100,3,112, 18,120,74,230,126,0,144,255,241,240,18,5,196,239,96,3,127,1,34,120,75,230,84,255,144, 255,241,240,18,5,196,239,96,3,127,1,34,120,71,230,68,1,144,255,243,240,144,255,241,228, *************** *** 248,269 **** 230,22,24,112,1,22,128,186,128,7,144,255,240,224,68,2,240,18,5,163,239,96,3,127,1, 34,144,255,242,224,255,120,80,134,3,24,134,2,24,134,1,18,4,158,127,0,34,120,63,166, ! 7,144,255,240,224,84,252,240,120,66,230,8,70,112,3,127,0,34,120,97,230,20,112,11,120, 65,230,195,51,144,255,243,240,128,110,120,63,230,84,7,120,61,246,120,61,230,195,51,246,120, ! 61,230,68,160,246,120,97,230,100,2,112,33,120,64,230,211,148,0,64,25,120,64,230,126,0, 84,7,120,62,246,120,62,230,195,51,246,120,62,134,7,120,61,230,79,246,120,61,230,144,255, ! 243,240,120,97,230,100,3,112,18,120,64,230,126,0,144,255,241,240,18,5,196,239,96,3,127, 1,34,120,65,230,84,255,144,255,241,240,18,5,196,239,96,3,127,1,34,211,120,67,230,148, 1,24,230,148,0,64,42,120,70,6,230,24,134,2,112,1,6,20,24,134,1,251,18,4,247, 144,255,241,239,240,18,5,196,239,96,3,127,1,34,120,67,230,22,24,112,1,22,128,202,144, 255,240,224,68,1,240,120,70,134,3,24,134,2,24,134,1,18,4,247,144,255,241,239,240,18, ! 5,196,239,96,3,127,1,34,127,0,34,120,132,230,4,112,3,2,8,114,120,132,230,195,148, ! 9,64,12,120,48,118,8,120,132,230,36,248,246,128,40,120,132,230,195,148,8,80,12,120,132, ! 230,120,48,246,120,132,118,255,128,20,120,48,118,8,120,133,230,20,112,6,120,132,118,0,128, ! 4,120,132,118,255,120,49,118,0,120,49,230,195,120,48,150,80,37,120,137,6,230,24,134,2, 112,1,6,20,24,134,1,251,18,4,247,120,49,230,36,248,245,130,228,52,254,245,131,239,240, ! 120,49,6,128,210,120,48,230,84,127,144,255,129,240,34,120,135,166,5,8,166,6,8,166,7, ! 144,255,7,224,96,11,144,255,7,228,240,144,255,6,116,254,240,144,255,6,224,195,120,132,150, ! 80,7,144,255,6,224,120,132,246,144,255,6,224,211,120,132,150,64,6,120,133,118,1,128,4, ! 120,133,118,0,18,7,242,34,120,135,228,246,8,246,8,246,120,132,246,18,7,242,34,144,255, 128,224,68,8,240,163,163,224,68,8,240,34,144,255,0,224,84,128,96,16,120,59,118,0,8, 118,1,144,255,252,224,68,1,240,128,13,120,59,228,246,8,246,144,255,252,224,84,254,240,144, --- 249,270 ---- 230,22,24,112,1,22,128,186,128,7,144,255,240,224,68,2,240,18,5,163,239,96,3,127,1, 34,144,255,242,224,255,120,80,134,3,24,134,2,24,134,1,18,4,158,127,0,34,120,63,166, ! 7,144,255,240,224,84,252,240,120,66,230,8,70,112,3,127,0,34,120,98,230,20,112,11,120, 65,230,195,51,144,255,243,240,128,110,120,63,230,84,7,120,61,246,120,61,230,195,51,246,120, ! 61,230,68,160,246,120,98,230,100,2,112,33,120,64,230,211,148,0,64,25,120,64,230,126,0, 84,7,120,62,246,120,62,230,195,51,246,120,62,134,7,120,61,230,79,246,120,61,230,144,255, ! 243,240,120,98,230,100,3,112,18,120,64,230,126,0,144,255,241,240,18,5,196,239,96,3,127, 1,34,120,65,230,84,255,144,255,241,240,18,5,196,239,96,3,127,1,34,211,120,67,230,148, 1,24,230,148,0,64,42,120,70,6,230,24,134,2,112,1,6,20,24,134,1,251,18,4,247, 144,255,241,239,240,18,5,196,239,96,3,127,1,34,120,67,230,22,24,112,1,22,128,202,144, 255,240,224,68,1,240,120,70,134,3,24,134,2,24,134,1,18,4,247,144,255,241,239,240,18, ! 5,196,239,96,3,127,1,34,127,0,34,120,133,230,4,112,3,2,8,114,120,133,230,195,148, ! 9,64,12,120,48,118,8,120,133,230,36,248,246,128,40,120,133,230,195,148,8,80,12,120,133, ! 230,120,48,246,120,133,118,255,128,20,120,48,118,8,120,134,230,20,112,6,120,133,118,0,128, ! 4,120,133,118,255,120,49,118,0,120,49,230,195,120,48,150,80,37,120,138,6,230,24,134,2, 112,1,6,20,24,134,1,251,18,4,247,120,49,230,36,248,245,130,228,52,254,245,131,239,240, ! 120,49,6,128,210,120,48,230,84,127,144,255,129,240,34,120,136,166,5,8,166,6,8,166,7, ! 144,255,7,224,96,11,144,255,7,228,240,144,255,6,116,254,240,144,255,6,224,195,120,133,150, ! 80,7,144,255,6,224,120,133,246,144,255,6,224,211,120,133,150,64,6,120,134,118,1,128,4, ! 120,134,118,0,18,7,242,34,120,136,228,246,8,246,8,246,120,133,246,18,7,242,34,144,255, 128,224,68,8,240,163,163,224,68,8,240,34,144,255,0,224,84,128,96,16,120,59,118,0,8, 118,1,144,255,252,224,68,1,240,128,13,120,59,228,246,8,246,144,255,252,224,84,254,240,144, *************** *** 275,280 **** 144,255,6,224,100,2,112,4,163,224,96,4,18,8,198,34,144,255,131,228,240,144,255,0,224, 84,31,255,18,4,49,9,166,0,9,206,1,9,232,2,10,132,3,0,0,10,132,144,255,4, ! 224,96,4,18,8,198,34,120,132,118,2,144,255,252,224,84,4,100,4,112,4,120,56,118,1, ! 125,0,126,0,127,56,18,8,115,2,10,137,144,255,4,224,96,4,18,8,198,34,120,132,118, 2,125,0,126,0,127,56,18,8,115,2,10,137,144,255,4,224,84,15,120,53,246,120,53,230, 112,30,144,255,4,224,84,128,96,11,144,255,128,224,84,8,120,56,246,128,9,144,255,130,224, --- 276,281 ---- 144,255,6,224,100,2,112,4,163,224,96,4,18,8,198,34,144,255,131,228,240,144,255,0,224, 84,31,255,18,4,49,9,166,0,9,206,1,9,232,2,10,132,3,0,0,10,132,144,255,4, ! 224,96,4,18,8,198,34,120,133,118,2,144,255,252,224,84,4,100,4,112,4,120,56,118,1, ! 125,0,126,0,127,56,18,8,115,2,10,137,144,255,4,224,96,4,18,8,198,34,120,133,118, 2,125,0,126,0,127,56,18,8,115,2,10,137,144,255,4,224,84,15,120,53,246,120,53,230, 112,30,144,255,4,224,84,128,96,11,144,255,128,224,84,8,120,56,246,128,9,144,255,130,224, *************** *** 283,287 **** 130,239,52,255,245,131,224,84,8,120,56,246,128,32,120,53,230,255,126,0,238,126,3,207,195, 51,207,51,222,249,207,36,8,245,130,239,52,255,245,131,224,84,8,120,56,246,120,56,230,117, ! 240,8,132,246,120,132,118,2,125,0,126,0,127,56,18,8,115,128,5,18,8,198,128,0,2, 14,68,120,60,230,20,24,70,112,4,18,8,198,34,144,255,6,224,112,4,163,224,96,4,18, 8,198,34,144,255,130,224,68,8,240,144,255,0,224,84,31,255,18,4,49,11,77,0,11,77, --- 284,288 ---- 130,239,52,255,245,131,224,84,8,120,56,246,128,32,120,53,230,255,126,0,238,126,3,207,195, 51,207,51,222,249,207,36,8,245,130,239,52,255,245,131,224,84,8,120,56,246,120,56,230,117, ! 240,8,132,246,120,133,118,2,125,0,126,0,127,56,18,8,115,128,5,18,8,198,128,0,2, 14,68,120,60,230,20,24,70,112,4,18,8,198,34,144,255,6,224,112,4,163,224,96,4,18, 8,198,34,144,255,130,224,68,8,240,144,255,0,224,84,31,255,18,4,49,11,77,0,11,77, *************** *** 305,322 **** 18,8,198,34,120,59,230,8,70,112,4,18,8,198,34,144,255,6,224,255,163,224,79,112,4, 18,8,198,34,144,255,131,228,240,144,255,3,224,255,18,4,49,12,162,1,12,177,2,12,192, ! 3,12,252,4,12,252,5,0,0,12,252,120,132,118,18,127,164,126,254,125,1,18,8,115,128, ! 79,120,132,118,32,127,182,126,254,125,1,18,8,115,128,64,144,255,2,224,20,112,15,120,132, ! 118,28,125,2,126,27,127,0,18,8,115,128,42,144,255,2,224,100,2,112,15,120,132,118,42, ! 125,2,126,26,127,196,18,8,115,128,19,120,132,118,42,125,2,126,26,127,196,18,8,115,128, 4,18,8,198,34,2,14,68,144,255,0,224,84,31,96,4,18,8,198,34,120,59,230,8,70, 112,4,18,8,198,34,144,255,4,224,96,4,18,8,198,34,144,255,2,224,112,4,163,224,96, 4,18,8,198,34,144,255,6,224,20,112,4,163,224,96,4,18,8,198,34,144,255,131,228,240, ! 120,132,118,1,253,254,127,134,18,8,115,2,14,68,144,255,0,224,84,31,96,4,18,8,198, 34,120,60,230,20,24,70,112,4,18,8,198,34,144,255,4,224,96,4,18,8,198,34,144,255, 7,224,112,6,144,255,6,224,96,4,18,8,198,34,144,255,130,224,68,8,240,144,255,2,224, ! 195,148,2,64,4,18,8,198,34,144,255,2,224,120,134,246,18,8,183,34,144,255,0,224,84, 31,20,96,4,18,8,198,34,144,255,4,224,96,4,18,8,198,34,120,59,230,8,70,112,4, 18,8,198,34,144,255,2,224,112,4,163,224,96,4,18,8,198,34,144,255,6,224,20,112,4, ! 163,224,96,4,18,8,198,34,144,255,131,228,240,120,132,118,1,253,254,127,56,18,8,115,128, 78,144,255,0,224,84,31,20,96,4,18,8,198,34,144,255,4,224,96,4,18,8,198,34,120, 60,230,20,24,70,112,4,18,8,198,34,144,255,6,224,112,4,163,224,96,4,18,8,198,34, --- 306,323 ---- 18,8,198,34,120,59,230,8,70,112,4,18,8,198,34,144,255,6,224,255,163,224,79,112,4, 18,8,198,34,144,255,131,228,240,144,255,3,224,255,18,4,49,12,162,1,12,177,2,12,192, ! 3,12,252,4,12,252,5,0,0,12,252,120,133,118,18,127,164,126,254,125,1,18,8,115,128, ! 79,120,133,118,32,127,182,126,254,125,1,18,8,115,128,64,144,255,2,224,20,112,15,120,133, ! 118,28,125,2,126,28,127,112,18,8,115,128,42,144,255,2,224,100,2,112,15,120,133,118,42, ! 125,2,126,28,127,52,18,8,115,128,19,120,133,118,42,125,2,126,28,127,52,18,8,115,128, 4,18,8,198,34,2,14,68,144,255,0,224,84,31,96,4,18,8,198,34,120,59,230,8,70, 112,4,18,8,198,34,144,255,4,224,96,4,18,8,198,34,144,255,2,224,112,4,163,224,96, 4,18,8,198,34,144,255,6,224,20,112,4,163,224,96,4,18,8,198,34,144,255,131,228,240, ! 120,133,118,1,253,254,127,135,18,8,115,2,14,68,144,255,0,224,84,31,96,4,18,8,198, 34,120,60,230,20,24,70,112,4,18,8,198,34,144,255,4,224,96,4,18,8,198,34,144,255, 7,224,112,6,144,255,6,224,96,4,18,8,198,34,144,255,130,224,68,8,240,144,255,2,224, ! 195,148,2,64,4,18,8,198,34,144,255,2,224,120,135,246,18,8,183,34,144,255,0,224,84, 31,20,96,4,18,8,198,34,144,255,4,224,96,4,18,8,198,34,120,59,230,8,70,112,4, 18,8,198,34,144,255,2,224,112,4,163,224,96,4,18,8,198,34,144,255,6,224,20,112,4, ! 163,224,96,4,18,8,198,34,144,255,131,228,240,120,133,118,1,253,254,127,56,18,8,115,128, 78,144,255,0,224,84,31,20,96,4,18,8,198,34,144,255,4,224,96,4,18,8,198,34,120, 60,230,20,24,70,112,4,18,8,198,34,144,255,6,224,112,4,163,224,96,4,18,8,198,34, *************** *** 325,341 **** 1,224,255,100,146,112,66,144,255,4,224,255,126,0,163,224,251,122,0,139,2,228,120,55,47, 246,238,58,24,246,195,120,55,230,148,26,24,230,148,0,80,17,120,55,230,24,36,214,245,130, ! 230,52,254,245,131,120,56,224,246,120,132,118,1,125,0,126,0,127,56,18,8,115,34,18,8, 198,34,18,8,198,34,34,144,255,252,228,240,120,81,246,120,81,230,195,148,18,80,34,120,81, ! 230,36,238,245,130,228,52,26,245,131,228,147,255,120,81,230,36,164,245,130,228,52,254,245,131, ! 239,240,120,81,6,128,214,120,81,118,0,120,81,230,195,148,32,80,34,120,81,230,36,28,245, ! 130,228,52,27,245,131,228,147,255,120,81,230,36,182,245,130,228,52,254,245,131,239,240,120,81, 6,128,214,144,255,8,228,240,127,1,18,5,124,144,255,144,224,68,128,240,127,2,18,5,145, 120,81,118,0,120,81,230,195,148,26,80,42,120,81,230,255,228,120,74,246,8,166,7,8,246, 8,118,1,120,81,230,36,214,120,80,246,24,228,52,254,246,24,118,1,127,0,18,5,229,120, ! 81,6,128,206,34,120,132,118,255,120,135,228,246,8,246,8,246,18,8,212,34,144,255,131,228, ! 240,120,132,230,4,112,9,144,255,128,224,68,8,240,128,3,18,7,242,34,144,255,255,228,240, ! 120,132,118,255,120,135,246,8,246,8,246,120,134,246,144,255,128,116,132,240,163,163,240,144,255, 253,4,240,144,255,9,116,196,240,144,255,13,240,163,163,116,16,240,144,255,8,116,132,240,144, ! 255,81,116,204,240,144,255,85,240,163,163,116,32,240,144,255,80,116,132,240,144,255,10,228,240, 144,255,14,240,144,255,82,116,128,240,144,255,86,240,34,192,208,192,224,192,131,192,130,192,240, 192,0,192,1,192,2,192,3,192,4,192,5,192,6,192,7,144,255,146,224,255,18,4,49,16, --- 326,342 ---- 1,224,255,100,146,112,66,144,255,4,224,255,126,0,163,224,251,122,0,139,2,228,120,55,47, 246,238,58,24,246,195,120,55,230,148,26,24,230,148,0,80,17,120,55,230,24,36,214,245,130, ! 230,52,254,245,131,120,56,224,246,120,133,118,1,125,0,126,0,127,56,18,8,115,34,18,8, 198,34,18,8,198,34,34,144,255,252,228,240,120,81,246,120,81,230,195,148,18,80,34,120,81, ! 230,36,94,245,130,228,52,28,245,131,228,147,255,120,81,230,36,164,245,130,228,52,254,245,131, ! 239,240,120,81,6,128,214,120,81,118,0,120,81,230,195,148,32,80,34,120,81,230,36,140,245, ! 130,228,52,28,245,131,228,147,255,120,81,230,36,182,245,130,228,52,254,245,131,239,240,120,81, 6,128,214,144,255,8,228,240,127,1,18,5,124,144,255,144,224,68,128,240,127,2,18,5,145, 120,81,118,0,120,81,230,195,148,26,80,42,120,81,230,255,228,120,74,246,8,166,7,8,246, 8,118,1,120,81,230,36,214,120,80,246,24,228,52,254,246,24,118,1,127,0,18,5,229,120, ! 81,6,128,206,34,120,133,118,255,120,136,228,246,8,246,8,246,18,8,212,34,144,255,131,228, ! 240,120,133,230,4,112,9,144,255,128,224,68,8,240,128,3,18,7,242,34,144,255,255,228,240, ! 120,133,118,255,120,136,246,8,246,8,246,120,135,246,144,255,128,116,132,240,163,163,240,144,255, 253,4,240,144,255,9,116,196,240,144,255,13,240,163,163,116,16,240,144,255,8,116,132,240,144, ! 255,81,116,198,240,144,255,85,240,163,163,116,32,240,144,255,80,116,132,240,144,255,10,228,240, 144,255,14,240,144,255,82,116,128,240,144,255,86,240,34,192,208,192,224,192,131,192,130,192,240, 192,0,192,1,192,2,192,3,192,4,192,5,192,6,192,7,144,255,146,224,255,18,4,49,16, *************** *** 346,353 **** 128,23,144,255,146,228,240,128,16,144,255,146,228,240,128,9,144,255,146,228,240,128,2,128,0, 208,7,208,6,208,5,208,4,208,3,208,2,208,1,208,0,208,240,208,130,208,131,208,224,208, ! 208,50,192,0,120,130,6,117,140,207,208,0,50,67,135,128,194,153,117,153,170,117,144,0,117, ! 160,255,18,14,171,18,15,128,117,137,1,210,140,117,138,0,117,140,0,120,130,118,0,120,131, ! 118,0,210,169,210,175,210,168,144,255,252,224,68,128,240,120,88,118,0,120,82,118,0,120,82, ! 230,195,148,8,64,3,2,17,224,120,82,230,36,89,248,118,0,120,82,230,255,126,0,239,117, 240,20,164,206,175,240,117,240,20,164,47,206,36,128,245,130,238,52,253,245,131,228,240,163,240, 163,116,253,240,163,116,232,240,120,82,230,255,126,0,239,117,240,20,164,206,175,240,117,240,20, --- 347,354 ---- 128,23,144,255,146,228,240,128,16,144,255,146,228,240,128,9,144,255,146,228,240,128,2,128,0, 208,7,208,6,208,5,208,4,208,3,208,2,208,1,208,0,208,240,208,130,208,131,208,224,208, ! 208,50,192,0,120,131,6,117,140,207,208,0,50,67,135,128,194,153,117,153,170,117,144,0,117, ! 160,255,18,14,171,18,15,128,117,137,1,210,140,117,138,0,117,140,0,120,131,118,0,120,132, ! 118,0,210,169,210,175,210,168,144,255,252,224,68,128,240,120,89,118,0,120,82,118,0,120,82, ! 230,195,148,8,64,3,2,17,224,120,82,230,36,90,248,118,0,120,82,230,255,126,0,239,117, 240,20,164,206,175,240,117,240,20,164,47,206,36,128,245,130,238,52,253,245,131,228,240,163,240, 163,116,253,240,163,116,232,240,120,82,230,255,126,0,239,117,240,20,164,206,175,240,117,240,20, *************** *** 359,363 **** 82,230,255,126,0,239,117,240,20,164,206,175,240,117,240,20,164,47,206,36,128,255,238,52,253, 254,125,1,143,3,142,2,141,1,127,136,126,19,125,0,124,0,116,16,18,4,182,120,82,6, ! 2,16,225,144,255,10,224,84,128,112,3,2,20,172,144,254,32,224,84,7,120,83,246,120,82, 118,0,120,83,230,84,2,96,6,120,82,230,68,2,246,120,83,230,84,1,96,6,120,82,230, 68,4,246,120,83,230,84,4,96,6,120,82,230,68,1,246,120,82,230,255,126,0,239,117,240, --- 360,364 ---- 82,230,255,126,0,239,117,240,20,164,206,175,240,117,240,20,164,47,206,36,128,255,238,52,253, 254,125,1,143,3,142,2,141,1,127,136,126,19,125,0,124,0,116,16,18,4,182,120,82,6, ! 2,16,225,144,255,10,224,84,128,112,3,2,20,189,144,254,32,224,84,7,120,83,246,120,82, 118,0,120,83,230,84,2,96,6,120,82,230,68,2,246,120,83,230,84,1,96,6,120,82,230, 68,4,246,120,83,230,84,4,96,6,120,82,230,68,1,246,120,82,230,255,126,0,239,117,240, *************** *** 369,373 **** 1,144,254,37,224,255,116,2,18,4,153,120,82,230,255,126,0,239,117,240,20,164,206,175,240, 117,240,20,164,47,206,36,128,255,238,52,253,254,125,1,123,12,122,0,116,1,18,5,106,141, ! 1,144,254,36,224,255,116,3,18,4,153,120,82,230,36,89,248,230,112,68,120,82,230,255,126, 0,239,117,240,20,164,206,175,240,117,240,20,164,47,206,36,128,251,238,52,253,250,121,1,116, 12,18,5,25,120,82,230,251,122,0,235,117,240,20,164,202,171,240,117,240,20,164,43,202,36, --- 370,374 ---- 1,144,254,37,224,255,116,2,18,4,153,120,82,230,255,126,0,239,117,240,20,164,206,175,240, 117,240,20,164,47,206,36,128,255,238,52,253,254,125,1,123,12,122,0,116,1,18,5,106,141, ! 1,144,254,36,224,255,116,3,18,4,153,120,82,230,36,90,248,230,112,68,120,82,230,255,126, 0,239,117,240,20,164,206,175,240,117,240,20,164,47,206,36,128,251,238,52,253,250,121,1,116, 12,18,5,25,120,82,230,251,122,0,235,117,240,20,164,202,171,240,117,240,20,164,43,202,36, *************** *** 387,458 **** 255,116,2,18,4,153,120,82,230,255,126,0,239,117,240,20,164,206,175,240,117,240,20,164,47, 206,36,128,255,238,52,253,254,125,1,123,16,122,0,116,1,18,5,106,141,1,144,254,44,224, ! 255,116,3,18,4,153,120,82,230,36,89,248,118,1,144,255,10,228,240,120,131,230,120,130,102, ! 112,3,2,17,224,120,131,6,120,88,230,117,240,32,132,36,89,248,230,96,113,120,88,230,68, ! 1,245,144,117,128,0,117,128,2,120,82,118,0,120,82,230,195,148,15,80,85,120,86,230,84, ! 64,254,228,78,96,5,117,128,3,128,3,117,128,2,117,176,255,117,176,0,117,176,255,117,176, ! 0,120,88,230,68,1,68,2,245,144,117,176,255,117,176,0,117,176,255,117,176,0,117,176,255, ! 117,176,0,120,88,230,68,1,245,144,117,176,255,117,176,0,120,87,230,195,51,246,24,230,51, ! 246,120,82,6,128,163,117,128,0,120,88,230,36,32,246,120,88,230,117,240,32,132,120,82,246, ! 120,85,118,2,120,82,230,255,126,0,239,117,240,20,164,206,175,240,117,240,20,164,47,206,36, ! 128,251,238,52,253,250,121,1,116,16,18,5,25,120,102,166,4,8,166,5,8,166,6,8,166, 7,120,82,230,255,126,0,239,117,240,20,164,206,175,240,117,240,20,164,47,206,36,128,251,238, ! 52,253,250,121,1,116,4,18,5,25,120,106,166,4,8,166,5,8,166,6,8,166,7,120,126, ! 166,4,8,166,5,8,166,6,8,166,7,120,82,230,255,126,0,239,117,240,20,164,206,175,240, ! 117,240,20,164,47,206,36,128,251,238,52,253,250,121,1,116,8,18,5,25,120,110,166,4,8, ! 166,5,8,166,6,8,166,7,120,82,230,255,126,0,239,117,240,20,164,206,175,240,117,240,20, ! 164,47,206,36,128,251,238,52,253,250,121,1,116,12,18,5,25,120,114,166,4,8,166,5,8, ! 166,6,8,166,7,120,113,134,7,24,134,6,24,134,5,24,134,4,120,117,134,3,24,134,2, ! 24,134,1,24,134,0,18,1,9,120,98,166,4,8,166,5,8,166,6,8,166,7,120,118,166, ! 4,8,166,5,8,166,6,8,166,7,120,121,134,7,24,134,6,24,134,5,24,134,4,228,251, ! 250,249,248,116,10,18,0,206,112,29,120,121,134,7,24,134,6,24,134,5,24,134,4,18,0, ! 192,120,118,166,4,8,166,5,8,166,6,8,166,7,120,129,134,7,24,134,6,24,134,5,24, ! 134,4,228,251,250,249,248,116,10,18,0,206,112,29,120,129,134,7,24,134,6,24,134,5,24, ! 134,4,18,0,192,120,126,166,4,8,166,5,8,166,6,8,166,7,120,105,134,7,24,134,6, ! 24,134,5,24,134,4,120,129,134,3,24,134,2,24,134,1,24,134,0,116,2,18,0,206,112, ! 70,120,105,134,7,24,134,6,24,134,5,24,134,4,120,121,134,3,24,134,2,24,134,1,24, ! 134,0,116,2,18,0,206,112,37,120,106,228,246,8,246,8,246,8,246,120,117,230,24,134,6, ! 24,134,5,24,134,4,120,110,166,4,8,166,5,8,166,6,8,246,2,26,54,120,98,230,8, ! 70,8,70,8,70,112,16,120,122,118,31,8,118,255,8,118,255,8,118,255,2,23,191,120,109, ! 134,7,24,134,6,24,134,5,24,134,4,18,3,234,143,3,142,2,141,1,140,0,136,240,120, ! 109,134,7,24,134,6,24,134,5,24,134,4,168,240,18,3,234,192,0,192,1,192,2,192,3, ! 123,0,122,0,121,0,120,191,18,1,50,208,3,208,2,208,1,208,0,18,1,50,143,3,142, ! 2,141,1,140,0,136,240,120,101,134,7,24,134,6,24,134,5,24,134,4,168,240,18,3,234, ! 236,200,252,237,201,253,238,202,254,239,203,255,18,2,160,18,3,175,120,122,166,4,8,166,5, ! 8,166,6,8,166,7,120,125,134,7,24,134,6,24,134,5,24,134,4,228,251,250,249,248,116, ! 10,18,0,206,112,29,120,125,134,7,24,134,6,24,134,5,24,134,4,18,0,192,120,122,166, ! 4,8,166,5,8,166,6,8,166,7,120,101,134,7,24,134,6,24,134,5,24,134,4,228,251, ! 250,249,248,116,6,18,0,206,112,97,120,109,134,7,24,134,6,24,134,5,24,134,4,228,251, ! 250,249,248,116,6,18,0,206,112,6,120,85,118,1,128,66,120,105,134,7,24,134,6,24,134, ! 5,24,134,4,120,125,134,3,24,134,2,24,134,1,24,134,0,116,10,18,0,206,112,6,120, ! 85,118,0,128,27,120,85,118,1,120,125,134,7,24,134,6,24,134,5,24,134,4,121,0,123, ! 102,144,1,9,18,4,92,120,101,134,7,24,134,6,24,134,5,24,134,4,228,251,250,249,248, ! 116,10,18,0,206,112,97,120,109,134,7,24,134,6,24,134,5,24,134,4,228,251,250,249,248, ! 116,10,18,0,206,112,6,120,85,118,0,128,66,120,105,134,7,24,134,6,24,134,5,24,134, ! 4,120,125,134,3,24,134,2,24,134,1,24,134,0,116,10,18,0,206,112,6,120,85,118,1, ! 128,27,120,85,118,0,120,125,134,7,24,134,6,24,134,5,24,134,4,121,0,123,102,144,1, ! 9,18,4,92,120,85,230,112,25,120,105,134,7,24,134,6,24,134,5,24,134,4,121,0,123, ! 106,144,0,249,18,4,92,128,29,120,85,230,20,112,23,120,105,134,7,24,134,6,24,134,5, ! 24,134,4,121,0,123,106,144,1,9,18,4,92,120,109,134,7,24,134,6,24,134,5,24,134, ! 4,228,251,250,249,248,116,6,18,0,206,112,107,120,82,230,255,126,0,239,117,240,20,164,206, ! 175,240,117,240,20,164,47,206,36,128,245,130,238,52,253,245,131,224,252,163,224,253,163,224,254, ! 163,224,255,120,109,134,3,24,134,2,24,134,1,24,134,0,116,10,18,0,206,112,47,120,82, ! 230,255,126,0,239,117,240,20,164,206,175,240,117,240,20,164,47,206,36,128,245,130,238,52,253, ! 245,131,120,106,224,246,8,163,224,246,8,163,224,246,8,163,224,246,128,119,120,109,134,7,24, ! 134,6,24,134,5,24,134,4,18,0,192,120,82,230,251,122,0,235,117,240,20,164,202,171,240, ! 117,240,20,164,43,202,36,128,245,130,234,52,253,245,131,224,248,163,224,249,163,224,250,163,224, ! 251,116,6,18,0,206,112,56,120,82,230,255,126,0,239,117,240,20,164,206,175,240,117,240,20, ! 164,47,206,36,128,245,130,238,52,253,245,131,224,252,163,224,253,163,224,254,163,224,255,18,0, ! 192,120,106,166,4,8,166,5,8,166,6,8,166,7,120,109,134,7,24,134,6,24,134,5,24, ! 134,4,121,0,123,110,144,0,249,18,4,92,120,113,134,7,24,134,6,24,134,5,24,134,4, ! 123,7,18,1,26,120,86,166,6,8,166,7,120,82,230,255,126,0,239,117,240,20,164,206,175, ! 240,117,240,20,164,47,206,36,128,255,238,52,253,254,125,1,143,3,142,2,141,1,120,113,134, ! 7,24,134,6,24,134,5,24,134,4,116,8,18,4,182,120,82,230,255,126,0,239,117,240,20, ! 164,206,175,240,117,240,20,164,47,206,36,128,255,238,52,253,254,125,1,143,3,142,2,141,1, ! 120,109,134,7,24,134,6,24,134,5,24,134,4,116,4,18,4,182,229,160,84,128,112,2,128, ! 248,2,17,224,42,3,80,0,104,0,105,0,100,0,103,0,101,0,116,0,65,0,100,0,118, ! 0,97,0,110,0,99,0,101,0,100,0,83,0,101,0,114,0,118,0,111,0,18,1,16,1, ! 0,0,0,8,194,6,59,0,0,1,1,2,3,1,28,3,80,0,104,0,105,0,100,0,103, ! 0,101,0,116,0,115,0,32,0,73,0,110,0,99,0,46,0,9,2,32,0,1,1,0,128, ! 50,9,4,0,0,2,255,0,255,0,7,5,1,2,16,0,0,7,5,130,2,32,0,0,}; #define ANALOG_FIRMWARE_SIZE 3451 --- 388,475 ---- 255,116,2,18,4,153,120,82,230,255,126,0,239,117,240,20,164,206,175,240,117,240,20,164,47, 206,36,128,255,238,52,253,254,125,1,123,16,122,0,116,1,18,5,106,141,1,144,254,44,224, ! 255,116,3,18,4,153,144,254,33,224,4,112,10,120,82,230,36,90,248,118,1,128,8,120,82, ! 230,36,90,248,118,2,144,255,10,228,240,120,132,230,120,131,102,112,3,2,17,224,120,132,6, ! 120,89,230,117,240,32,132,36,90,248,230,20,112,113,120,89,230,68,1,245,144,117,128,0,117, ! 128,2,120,82,118,0,120,82,230,195,148,15,80,85,120,87,230,84,64,254,228,78,96,5,117, ! 128,3,128,3,117,128,2,117,176,255,117,176,0,117,176,255,117,176,0,120,89,230,68,1,68, ! 2,245,144,117,176,255,117,176,0,117,176,255,117,176,0,117,176,255,117,176,0,120,89,230,68, ! 1,245,144,117,176,255,117,176,0,120,88,230,195,51,246,24,230,51,246,120,82,6,128,163,117, ! 128,0,120,89,230,36,32,246,120,86,230,195,148,51,80,3,2,22,171,120,86,230,36,205,120, ! 82,246,144,255,82,224,84,128,112,3,2,22,169,120,82,230,255,126,0,239,117,240,20,164,206, ! 175,240,117,240,20,164,47,206,36,128,255,238,52,253,254,125,1,171,7,170,6,169,5,116,8, ! 18,4,242,120,82,230,251,122,0,234,122,2,203,195,51,203,51,218,249,203,36,48,203,52,254, ! 250,121,1,116,3,18,4,153,120,82,230,255,126,0,239,117,240,20,164,206,175,240,117,240,20, ! 164,47,206,36,128,255,238,52,253,254,125,1,123,8,122,0,116,1,18,5,106,141,1,116,1, ! 18,4,242,120,82,230,251,122,0,234,122,2,203,195,51,203,51,218,249,203,36,48,203,52,254, ! 250,121,1,116,2,18,4,153,120,82,230,255,126,0,239,117,240,20,164,206,175,240,117,240,20, ! 164,47,206,36,128,255,238,52,253,254,125,1,123,8,122,0,116,1,18,5,106,141,1,116,2, ! 18,4,242,120,82,230,251,122,0,234,122,2,203,195,51,203,51,218,249,203,36,48,203,52,254, ! 250,121,1,116,1,18,4,153,120,82,230,255,126,0,239,117,240,20,164,206,175,240,117,240,20, ! 164,47,206,36,128,255,238,52,253,254,125,1,123,8,122,0,116,1,18,5,106,141,1,116,3, ! 18,4,242,120,82,230,251,122,0,234,122,2,203,195,51,203,51,218,249,203,36,48,245,130,235, ! 52,254,245,131,239,240,120,82,230,100,7,112,12,144,255,82,116,32,240,120,86,118,0,128,3, ! 120,86,6,128,3,120,86,6,120,89,230,117,240,32,132,120,82,246,120,85,118,2,120,82,230, ! 255,126,0,239,117,240,20,164,206,175,240,117,240,20,164,47,206,36,128,251,238,52,253,250,121, ! 1,116,16,18,5,25,120,103,166,4,8,166,5,8,166,6,8,166,7,120,82,230,255,126,0, ! 239,117,240,20,164,206,175,240,117,240,20,164,47,206,36,128,251,238,52,253,250,121,1,116,4, ! 18,5,25,120,107,166,4,8,166,5,8,166,6,8,166,7,120,127,166,4,8,166,5,8,166, ! 6,8,166,7,120,82,230,255,126,0,239,117,240,20,164,206,175,240,117,240,20,164,47,206,36, ! 128,251,238,52,253,250,121,1,116,8,18,5,25,120,111,166,4,8,166,5,8,166,6,8,166, 7,120,82,230,255,126,0,239,117,240,20,164,206,175,240,117,240,20,164,47,206,36,128,251,238, ! 52,253,250,121,1,116,12,18,5,25,120,115,166,4,8,166,5,8,166,6,8,166,7,120,114, ! 134,7,24,134,6,24,134,5,24,134,4,120,118,134,3,24,134,2,24,134,1,24,134,0,18, ! 1,9,120,99,166,4,8,166,5,8,166,6,8,166,7,120,119,166,4,8,166,5,8,166,6, ! 8,166,7,120,122,134,7,24,134,6,24,134,5,24,134,4,228,251,250,249,248,116,10,18,0, ! 206,112,29,120,122,134,7,24,134,6,24,134,5,24,134,4,18,0,192,120,119,166,4,8,166, ! 5,8,166,6,8,166,7,120,130,134,7,24,134,6,24,134,5,24,134,4,228,251,250,249,248, ! 116,10,18,0,206,112,29,120,130,134,7,24,134,6,24,134,5,24,134,4,18,0,192,120,127, ! 166,4,8,166,5,8,166,6,8,166,7,120,106,134,7,24,134,6,24,134,5,24,134,4,120, ! 130,134,3,24,134,2,24,134,1,24,134,0,116,2,18,0,206,112,70,120,106,134,7,24,134, ! 6,24,134,5,24,134,4,120,122,134,3,24,134,2,24,134,1,24,134,0,116,2,18,0,206, ! 112,37,120,107,228,246,8,246,8,246,8,246,120,118,230,24,134,6,24,134,5,24,134,4,120, ! 111,166,4,8,166,5,8,166,6,8,246,2,27,166,120,99,230,8,70,8,70,8,70,112,16, ! 120,123,118,31,8,118,255,8,118,255,8,118,255,2,25,47,120,110,134,7,24,134,6,24,134, ! 5,24,134,4,18,3,234,143,3,142,2,141,1,140,0,136,240,120,110,134,7,24,134,6,24, ! 134,5,24,134,4,168,240,18,3,234,192,0,192,1,192,2,192,3,123,0,122,0,121,0,120, ! 191,18,1,50,208,3,208,2,208,1,208,0,18,1,50,143,3,142,2,141,1,140,0,136,240, ! 120,102,134,7,24,134,6,24,134,5,24,134,4,168,240,18,3,234,236,200,252,237,201,253,238, ! 202,254,239,203,255,18,2,160,18,3,175,120,123,166,4,8,166,5,8,166,6,8,166,7,120, ! 126,134,7,24,134,6,24,134,5,24,134,4,228,251,250,249,248,116,10,18,0,206,112,29,120, ! 126,134,7,24,134,6,24,134,5,24,134,4,18,0,192,120,123,166,4,8,166,5,8,166,6, ! 8,166,7,120,102,134,7,24,134,6,24,134,5,24,134,4,228,251,250,249,248,116,6,18,0, ! 206,112,97,120,110,134,7,24,134,6,24,134,5,24,134,4,228,251,250,249,248,116,6,18,0, ! 206,112,6,120,85,118,1,128,66,120,106,134,7,24,134,6,24,134,5,24,134,4,120,126,134, ! 3,24,134,2,24,134,1,24,134,0,116,10,18,0,206,112,6,120,85,118,0,128,27,120,85, ! 118,1,120,126,134,7,24,134,6,24,134,5,24,134,4,121,0,123,103,144,1,9,18,4,92, ! 120,102,134,7,24,134,6,24,134,5,24,134,4,228,251,250,249,248,116,10,18,0,206,112,97, ! 120,110,134,7,24,134,6,24,134,5,24,134,4,228,251,250,249,248,116,10,18,0,206,112,6, ! 120,85,118,0,128,66,120,106,134,7,24,134,6,24,134,5,24,134,4,120,126,134,3,24,134, ! 2,24,134,1,24,134,0,116,10,18,0,206,112,6,120,85,118,1,128,27,120,85,118,0,120, ! 126,134,7,24,134,6,24,134,5,24,134,4,121,0,123,103,144,1,9,18,4,92,120,85,230, ! 112,25,120,106,134,7,24,134,6,24,134,5,24,134,4,121,0,123,107,144,0,249,18,4,92, ! 128,29,120,85,230,20,112,23,120,106,134,7,24,134,6,24,134,5,24,134,4,121,0,123,107, ! 144,1,9,18,4,92,120,110,134,7,24,134,6,24,134,5,24,134,4,228,251,250,249,248,116, ! 6,18,0,206,112,107,120,82,230,255,126,0,239,117,240,20,164,206,175,240,117,240,20,164,47, ! 206,36,128,245,130,238,52,253,245,131,224,252,163,224,253,163,224,254,163,224,255,120,110,134,3, ! 24,134,2,24,134,1,24,134,0,116,10,18,0,206,112,47,120,82,230,255,126,0,239,117,240, ! 20,164,206,175,240,117,240,20,164,47,206,36,128,245,130,238,52,253,245,131,120,107,224,246,8, ! 163,224,246,8,163,224,246,8,163,224,246,128,119,120,110,134,7,24,134,6,24,134,5,24,134, ! 4,18,0,192,120,82,230,251,122,0,235,117,240,20,164,202,171,240,117,240,20,164,43,202,36, ! 128,245,130,234,52,253,245,131,224,248,163,224,249,163,224,250,163,224,251,116,6,18,0,206,112, ! 56,120,82,230,255,126,0,239,117,240,20,164,206,175,240,117,240,20,164,47,206,36,128,245,130, ! 238,52,253,245,131,224,252,163,224,253,163,224,254,163,224,255,18,0,192,120,107,166,4,8,166, ! 5,8,166,6,8,166,7,120,110,134,7,24,134,6,24,134,5,24,134,4,121,0,123,111,144, ! 0,249,18,4,92,120,114,134,7,24,134,6,24,134,5,24,134,4,123,6,18,1,26,120,87, ! 166,6,8,166,7,120,82,230,255,126,0,239,117,240,20,164,206,175,240,117,240,20,164,47,206, ! 36,128,255,238,52,253,254,125,1,143,3,142,2,141,1,120,114,134,7,24,134,6,24,134,5, ! 24,134,4,116,8,18,4,182,120,82,230,255,126,0,239,117,240,20,164,206,175,240,117,240,20, ! 164,47,206,36,128,255,238,52,253,254,125,1,143,3,142,2,141,1,120,110,134,7,24,134,6, ! 24,134,5,24,134,4,116,4,18,4,182,229,160,84,128,112,2,128,248,2,17,224,42,3,80, ! 0,104,0,105,0,100,0,103,0,101,0,116,0,65,0,100,0,118,0,97,0,110,0,99,0, ! 101,0,100,0,83,0,101,0,114,0,118,0,111,0,18,1,16,1,0,0,0,8,194,6,59, ! 0,0,1,1,2,3,1,28,3,80,0,104,0,105,0,100,0,103,0,101,0,116,0,115,0, ! 32,0,73,0,110,0,99,0,46,0,9,2,32,0,1,1,0,128,50,9,4,0,0,2,255, ! 0,255,0,7,5,1,2,16,0,0,7,5,130,2,32,0,0,}; ! #define ANALOG_FIRMWARE_SIZE 3451 *************** *** 773,781 **** ! #define STEPPER1_FIRMWARE_SIZE 7329 ! const unsigned char STEPPER1_FIRMWARE[STEPPER1_FIRMWARE_SIZE] = {158, ! 28,111,2,0,14,2,16,111,0,0,0,0,0,2,17,42,117,129,175,120,175,118,0,216,252, 144,0,0,174,131,175,130,144,0,0,18,0,76,96,5,228,240,163,128,246,144,0,170,18,0, ! 85,144,0,174,18,0,85,144,0,178,18,0,115,144,0,184,18,0,115,117,208,0,18,19,60, 2,0,190,239,101,130,112,3,238,101,131,34,228,147,248,116,1,147,249,116,2,147,254,116,3, 147,245,130,142,131,232,105,112,1,34,228,147,246,163,8,128,244,228,147,252,116,1,147,253,116, --- 790,798 ---- ! #define STEPPER1_FIRMWARE_SIZE 7372 ! const unsigned char STEPPER1_FIRMWARE[STEPPER1_FIRMWARE_SIZE] = {201, ! 28,184,2,0,14,2,16,111,0,0,0,0,0,2,17,42,117,129,175,120,175,118,0,216,252, 144,0,0,174,131,175,130,144,0,0,18,0,76,96,5,228,240,163,128,246,144,0,170,18,0, ! 85,144,0,174,18,0,85,144,0,178,18,0,115,144,0,184,18,0,115,117,208,0,18,19,103, 2,0,190,239,101,130,112,3,238,101,131,34,228,147,248,116,1,147,249,116,2,147,254,116,3, 147,245,130,142,131,232,105,112,1,34,228,147,246,163,8,128,244,228,147,252,116,1,147,253,116, *************** *** 912,917 **** 5,0,0,13,140,120,170,118,18,127,164,126,254,125,1,18,9,3,128,79,120,170,118,32,127, 182,126,254,125,1,18,9,3,128,64,144,255,2,224,20,112,15,120,170,118,28,125,2,126,28, ! 127,98,18,9,3,128,42,144,255,2,224,100,2,112,15,120,170,118,42,125,2,126,28,127,38, ! 18,9,3,128,19,120,170,118,42,125,2,126,28,127,38,18,9,3,128,4,18,9,86,34,2, 14,212,144,255,0,224,84,31,96,4,18,9,86,34,120,59,230,8,70,112,4,18,9,86,34, 144,255,4,224,96,4,18,9,86,34,144,255,2,224,112,4,163,224,96,4,18,9,86,34,144, --- 929,934 ---- 5,0,0,13,140,120,170,118,18,127,164,126,254,125,1,18,9,3,128,79,120,170,118,32,127, 182,126,254,125,1,18,9,3,128,64,144,255,2,224,20,112,15,120,170,118,28,125,2,126,28, ! 127,141,18,9,3,128,42,144,255,2,224,100,2,112,15,120,170,118,42,125,2,126,28,127,81, ! 18,9,3,128,19,120,170,118,42,125,2,126,28,127,81,18,9,3,128,4,18,9,86,34,2, 14,212,144,255,0,224,84,31,96,4,18,9,86,34,120,59,230,8,70,112,4,18,9,86,34, 144,255,4,224,96,4,18,9,86,34,144,255,2,224,112,4,163,224,96,4,18,9,86,34,144, *************** *** 931,937 **** 120,55,230,148,26,24,230,148,0,80,17,120,55,230,24,36,214,245,130,230,52,254,245,131,120, 56,224,246,120,170,118,1,125,0,126,0,127,56,18,9,3,34,18,9,86,34,18,9,86,34, ! 34,144,255,252,228,240,120,81,246,120,81,230,195,148,18,80,34,120,81,230,36,80,245,130,228, 52,28,245,131,228,147,255,120,81,230,36,164,245,130,228,52,254,245,131,239,240,120,81,6,128, ! 214,120,81,118,0,120,81,230,195,148,32,80,34,120,81,230,36,126,245,130,228,52,28,245,131, 228,147,255,120,81,230,36,182,245,130,228,52,254,245,131,239,240,120,81,6,128,214,144,255,8, 228,240,127,1,18,6,12,144,255,144,224,68,128,240,127,2,18,6,33,120,81,118,0,120,81, --- 948,954 ---- 120,55,230,148,26,24,230,148,0,80,17,120,55,230,24,36,214,245,130,230,52,254,245,131,120, 56,224,246,120,170,118,1,125,0,126,0,127,56,18,9,3,34,18,9,86,34,18,9,86,34, ! 34,144,255,252,228,240,120,81,246,120,81,230,195,148,18,80,34,120,81,230,36,123,245,130,228, 52,28,245,131,228,147,255,120,81,230,36,164,245,130,228,52,254,245,131,239,240,120,81,6,128, ! 214,120,81,118,0,120,81,230,195,148,32,80,34,120,81,230,36,169,245,130,228,52,28,245,131, 228,147,255,120,81,230,36,182,245,130,228,52,254,245,131,239,240,120,81,6,128,214,144,255,8, 228,240,127,1,18,6,12,144,255,144,224,68,128,240,127,2,18,6,33,120,81,118,0,120,81, *************** *** 952,1072 **** 208,4,208,3,208,2,208,1,208,0,208,240,208,130,208,131,208,224,208,208,50,192,208,192,224, 192,131,192,130,192,240,192,0,192,1,192,2,192,3,192,4,192,5,192,6,192,7,117,140,253, ! 117,138,128,210,134,120,162,118,0,120,162,230,195,148,2,64,3,2,19,31,120,162,230,117,240, ! 26,164,36,128,248,230,8,134,7,120,168,246,8,166,7,120,167,230,112,3,2,17,253,120,163, ! 6,120,162,230,117,240,26,164,36,112,248,230,8,134,7,254,120,162,230,117,240,26,164,36,129, ! 248,230,47,246,24,230,62,246,120,162,230,117,240,26,164,36,128,248,230,8,134,7,120,168,102, ! 254,8,230,98,7,83,6,192,228,78,96,67,120,162,230,117,240,26,164,36,112,248,230,8,134, ! 7,100,128,195,148,128,80,24,120,162,230,117,240,26,164,36,133,248,22,120,162,230,117,240,26, ! 164,36,132,248,22,128,22,120,162,230,117,240,26,164,36,133,248,6,120,162,230,117,240,26,164, ! 36,132,248,6,2,18,128,120,164,6,120,162,230,117,240,26,164,36,114,248,230,8,134,7,254, ! 120,162,230,117,240,26,164,36,129,248,230,47,246,24,230,62,246,120,162,230,117,240,26,164,36, ! 128,248,230,8,134,7,120,168,102,254,8,230,98,7,83,6,192,228,78,96,67,120,162,230,117, ! 240,26,164,36,114,248,230,8,134,7,100,128,195,148,128,80,24,120,162,230,117,240,26,164,36, ! 134,248,22,120,162,230,117,240,26,164,36,132,248,22,128,22,120,162,230,117,240,26,164,36,134, ! 248,6,120,162,230,117,240,26,164,36,132,248,6,120,162,230,112,75,120,162,230,117,240,26,164, ! 36,132,248,230,84,3,255,18,4,193,18,166,0,18,176,1,18,186,2,18,196,3,0,0,18, ! 206,194,180,210,179,194,181,210,177,128,30,210,180,194,179,194,181,210,177,128,20,210,180,194,179, ! 210,181,194,177,128,10,194,180,210,179,210,181,194,177,128,0,128,73,120,162,230,117,240,26,164, ! 36,132,248,230,84,3,255,18,4,193,18,241,0,18,251,1,19,5,2,19,15,3,0,0,19, ! 25,194,160,210,161,194,164,210,165,128,30,210,160,194,161,194,164,210,165,128,20,210,160,194,161, ! 210,164,194,165,128,10,194,160,210,161,210,164,194,165,128,0,120,162,6,2,17,80,194,134,208, ! 7,208,6,208,5,208,4,208,3,208,2,208,1,208,0,208,240,208,130,208,131,208,224,208,208, ! 50,67,135,128,194,153,117,153,170,117,144,0,117,160,255,117,128,0,18,15,59,18,16,16,120, ! 163,118,0,120,164,118,0,120,90,118,0,120,167,118,0,120,82,118,0,120,82,230,195,148,2, ! 64,3,2,20,56,120,82,230,117,240,26,164,36,110,248,118,7,8,118,208,120,82,230,117,240, ! 26,164,255,123,0,122,0,239,36,114,248,166,2,8,166,3,139,7,138,6,120,82,230,117,240, ! 26,164,36,112,248,166,6,8,166,7,120,82,230,117,240,26,164,255,123,0,239,36,134,248,166, ! 3,139,7,120,82,230,117,240,26,164,36,133,248,166,7,120,82,230,117,240,26,164,36,116,248, ! 228,246,8,246,8,246,8,246,120,82,230,117,240,26,164,36,120,248,228,246,8,246,8,246,8, ! 246,120,82,230,117,240,26,164,36,124,248,228,246,8,246,8,246,8,246,120,82,230,117,240,26, ! 164,36,128,248,228,246,8,246,120,82,230,117,240,26,164,36,130,248,118,3,8,118,232,120,82, ! 230,117,240,26,164,36,132,248,118,0,120,82,230,117,240,26,164,36,135,248,118,0,120,82,6, ! 2,19,103,117,137,1,194,140,117,138,0,117,140,195,210,169,210,175,210,168,144,255,252,224,68, ! 128,240,194,178,194,176,194,162,194,163,120,167,230,96,16,120,167,118,0,120,163,230,120,92,246, ! 120,163,118,0,128,14,120,167,118,1,120,164,230,120,92,246,120,164,118,0,120,90,6,120,90, ! 230,100,50,96,3,2,21,21,144,255,82,224,84,128,112,3,2,21,17,120,82,118,0,120,82, ! 230,195,148,2,80,108,120,83,118,0,120,83,230,195,148,4,80,91,120,82,230,117,240,26,164, ! 36,116,255,228,254,253,120,83,230,251,228,192,5,192,6,192,7,250,127,3,126,0,239,195,155, ! 255,238,154,254,208,3,208,2,208,1,116,1,18,5,250,18,5,135,120,82,230,251,122,0,234, ! 122,2,203,195,51,203,51,218,249,250,235,120,83,38,251,228,58,203,36,96,245,130,235,52,254, ! 245,131,239,240,120,83,6,128,157,120,82,6,128,140,144,255,82,116,16,240,120,90,118,0,120, ! 82,118,0,120,82,230,195,148,2,64,3,2,26,114,120,85,118,2,120,167,230,96,81,120,82, ! 230,117,240,26,164,36,134,248,230,255,51,149,224,254,253,252,120,82,230,117,240,26,164,36,116, ! 251,121,0,144,1,114,18,4,236,120,82,230,117,240,26,164,36,134,248,118,0,120,82,230,117, ! 240,26,164,36,112,248,230,8,134,7,254,51,149,224,253,120,86,246,8,166,5,8,166,6,8, ! 166,7,128,79,120,82,230,117,240,26,164,36,133,248,230,255,51,149,224,254,253,252,120,82,230, ! 117,240,26,164,36,116,251,121,0,144,1,114,18,4,236,120,82,230,117,240,26,164,36,133,248, ! 118,0,120,82,230,117,240,26,164,36,114,248,230,8,134,7,254,51,149,224,253,120,86,246,8, ! 166,5,8,166,6,8,166,7,120,82,230,117,240,26,164,36,116,248,230,8,134,5,8,134,6, ! 8,134,7,252,120,82,230,117,240,26,164,36,120,248,230,8,134,1,8,134,2,8,134,3,248, ! 18,1,130,120,101,166,4,8,166,5,8,166,6,8,166,7,120,101,230,8,70,8,70,8,70, ! 112,3,2,22,179,120,89,134,7,24,134,6,24,134,5,24,134,4,120,89,134,3,24,134,2, ! 24,134,1,24,134,0,18,0,213,18,4,122,123,0,122,0,121,0,120,63,18,1,194,143,3, ! 142,2,141,1,140,0,136,240,120,104,134,7,24,134,6,24,134,5,24,134,4,168,240,18,4, ! 122,236,200,252,237,201,253,238,202,254,239,203,255,18,3,48,18,4,63,120,97,166,4,8,166, ! 5,8,166,6,8,166,7,120,100,134,7,24,134,6,24,134,5,24,134,4,228,251,250,249,248, ! 116,10,18,1,71,112,29,120,100,134,7,24,134,6,24,134,5,24,134,4,18,1,57,120,97, ! 166,4,8,166,5,8,166,6,8,166,7,128,58,120,89,134,7,24,134,6,24,134,5,24,134, ! 4,228,251,250,249,248,116,10,18,1,71,112,4,120,85,118,0,120,89,134,7,24,134,6,24, ! 134,5,24,134,4,228,251,250,249,248,116,6,18,1,71,112,4,120,85,118,1,120,82,230,117, ! 240,26,164,36,130,248,230,8,134,7,254,51,149,224,253,120,105,246,8,166,5,8,166,6,8, ! 166,7,127,5,121,0,123,105,144,1,171,18,4,236,120,104,134,7,24,134,6,24,134,5,24, ! 134,4,228,251,250,249,248,116,6,18,1,71,112,74,120,89,134,7,24,134,6,24,134,5,24, ! 134,4,228,251,250,249,248,116,6,18,1,71,112,6,120,85,118,1,128,43,120,108,134,7,24, ! 134,6,24,134,5,24,134,4,120,100,134,3,24,134,2,24,134,1,24,134,0,116,10,18,1, ! 71,112,6,120,85,118,0,128,4,120,85,118,1,120,104,134,7,24,134,6,24,134,5,24,134, ! 4,228,251,250,249,248,116,10,18,1,71,112,74,120,89,134,7,24,134,6,24,134,5,24,134, ! 4,228,251,250,249,248,116,10,18,1,71,112,6,120,85,118,0,128,43,120,108,134,7,24,134, ! 6,24,134,5,24,134,4,120,100,134,3,24,134,2,24,134,1,24,134,0,116,10,18,1,71, ! 112,6,120,85,118,1,128,4,120,85,118,0,120,82,230,117,240,26,164,36,124,248,230,8,134, ! 5,8,134,6,8,134,7,120,93,246,8,166,5,8,166,6,8,166,7,120,85,230,112,48,120, ! 82,230,117,240,26,164,36,130,248,230,8,134,7,254,120,92,230,251,122,0,18,0,192,238,51, ! 149,224,253,252,120,82,230,117,240,26,164,36,124,251,121,0,144,1,114,18,4,236,120,85,230, ! 20,112,48,120,82,230,117,240,26,164,36,130,248,230,8,134,7,254,120,92,230,251,122,0,18, ! 0,192,238,51,149,224,253,252,120,82,230,117,240,26,164,36,124,251,121,0,144,1,130,18,4, ! 236,120,167,230,112,3,2,25,112,120,82,230,117,240,26,164,36,124,248,230,8,134,5,8,134, ! 6,8,134,7,252,123,10,18,1,147,192,6,192,7,120,96,134,7,24,134,6,24,134,5,24, ! 134,4,123,10,18,1,147,208,224,195,159,255,208,224,158,254,120,82,230,117,240,26,164,36,112, ! 248,230,8,134,3,203,47,255,238,59,254,120,82,230,117,240,26,164,36,114,248,166,6,8,166, ! 7,120,82,230,117,240,26,164,36,114,248,230,8,134,7,254,120,82,230,117,240,26,164,36,110, ! 248,230,8,134,3,211,250,239,155,234,100,128,206,100,128,158,64,32,120,82,230,117,240,26,164, ! 36,110,248,230,8,134,7,254,120,82,230,117,240,26,164,36,114,248,166,6,8,166,7,128,86, ! 120,82,230,117,240,26,164,36,114,248,230,8,134,7,254,120,82,230,117,240,26,164,36,110,248, ! 230,8,134,3,250,195,228,155,251,228,154,195,250,239,155,234,100,128,206,100,128,158,80,37,120, ! 82,230,117,240,26,164,36,110,248,230,8,134,7,254,195,228,159,255,228,158,254,120,82,230,117, ! 240,26,164,36,114,248,166,6,8,166,7,2,26,108,120,82,230,117,240,26,164,36,124,248,230, ! 8,134,5,8,134,6,8,134,7,252,123,10,18,1,147,192,6,192,7,120,96,134,7,24,134, ! 6,24,134,5,24,134,4,123,10,18,1,147,208,224,195,159,255,208,224,158,254,120,82,230,117, ! 240,26,164,36,114,248,230,8,134,3,203,47,255,238,59,254,120,82,230,117,240,26,164,36,112, ! 248,166,6,8,166,7,120,82,230,117,240,26,164,36,112,248,230,8,134,7,254,120,82,230,117, ! 240,26,164,36,110,248,230,8,134,3,211,250,239,155,234,100,128,206,100,128,158,64,32,120,82, ! 230,117,240,26,164,36,110,248,230,8,134,7,254,120,82,230,117,240,26,164,36,112,248,166,6, ! 8,166,7,128,86,120,82,230,117,240,26,164,36,112,248,230,8,134,7,254,120,82,230,117,240, ! 26,164,36,110,248,230,8,134,3,250,195,228,155,251,228,154,195,250,239,155,234,100,128,206,100, ! 128,158,80,37,120,82,230,117,240,26,164,36,110,248,230,8,134,7,254,195,228,159,255,228,158, ! 254,120,82,230,117,240,26,164,36,112,248,166,6,8,166,7,120,82,6,2,21,25,120,92,118, ! 0,144,255,10,224,84,128,112,3,2,28,35,210,140,144,254,32,224,84,7,120,82,246,120,82, ! 230,195,148,2,64,3,2,28,30,120,82,230,117,240,26,164,36,135,248,144,254,33,224,246,120, ! 82,230,117,240,26,164,36,130,248,163,163,224,246,120,82,230,117,240,26,164,36,130,255,228,254, ! 253,143,3,142,2,141,1,144,254,34,224,255,116,1,18,5,41,120,82,230,117,240,26,164,36, ! 130,248,230,84,3,246,120,82,230,117,240,26,164,36,135,248,230,84,1,96,102,120,82,230,117, ! 240,26,164,36,116,248,144,254,39,224,246,120,82,230,117,240,26,164,36,116,255,228,254,253,143, ! 3,142,2,141,1,144,254,38,224,255,116,1,18,5,41,120,82,230,117,240,26,164,36,116,255, ! 228,254,253,143,3,142,2,141,1,144,254,37,224,255,116,2,18,5,41,120,82,230,117,240,26, ! 164,36,116,255,228,254,253,143,3,142,2,141,1,144,254,36,224,255,116,3,18,5,41,144,254, ! 43,224,255,121,0,122,0,123,97,18,5,46,144,254,42,224,255,121,0,122,0,123,98,18,5, ! 46,144,254,41,224,255,121,0,122,0,123,99,18,5,46,144,254,40,224,255,121,0,122,0,123, ! 100,18,5,46,120,82,230,117,240,26,164,36,135,248,230,84,4,96,33,120,82,230,117,240,26, ! 164,36,120,251,121,0,120,100,134,7,24,134,6,24,134,5,24,134,4,144,1,114,18,4,236, ! 128,40,120,82,230,117,240,26,164,255,120,100,134,3,24,134,2,24,134,1,24,134,0,136,240, ! 239,36,120,248,166,240,8,166,1,8,166,2,8,166,3,168,240,120,82,230,117,240,26,164,36, ! 110,248,144,254,45,224,246,120,82,230,117,240,26,164,36,110,255,228,254,253,143,3,142,2,141, ! 1,144,254,44,224,255,116,1,18,5,41,120,82,230,117,240,26,164,36,110,248,230,84,7,246, ! 144,255,10,228,240,2,20,88,42,3,80,0,104,0,105,0,100,0,103,0,101,0,116,0,65, ! 0,100,0,118,0,97,0,110,0,99,0,101,0,100,0,83,0,101,0,114,0,118,0,111,0, ! 18,1,16,1,0,0,0,8,194,6,70,0,0,1,1,2,3,1,28,3,80,0,104,0,105, ! 0,100,0,103,0,101,0,116,0,115,0,32,0,73,0,110,0,99,0,46,0,9,2,32,0, ! 1,1,0,128,50,9,4,0,0,2,255,0,255,0,7,5,1,2,16,0,0,7,5,130,2, ! 16,0,0,}; --- 969,1090 ---- 208,4,208,3,208,2,208,1,208,0,208,240,208,130,208,131,208,224,208,208,50,192,208,192,224, 192,131,192,130,192,240,192,0,192,1,192,2,192,3,192,4,192,5,192,6,192,7,117,140,253, ! 117,138,128,210,134,120,162,118,0,120,162,230,195,148,2,64,3,2,19,74,120,162,230,117,240, ! 26,164,36,135,248,230,84,8,112,3,2,19,45,120,162,230,117,240,26,164,36,128,248,230,8, ! 134,7,120,168,246,8,166,7,120,167,230,112,3,2,18,15,120,163,6,120,162,230,117,240,26, ! 164,36,112,248,230,8,134,7,254,120,162,230,117,240,26,164,36,129,248,230,47,246,24,230,62, ! 246,120,162,230,117,240,26,164,36,128,248,230,8,134,7,120,168,102,254,8,230,98,7,83,6, ! 192,228,78,96,67,120,162,230,117,240,26,164,36,112,248,230,8,134,7,100,128,195,148,128,80, ! 24,120,162,230,117,240,26,164,36,133,248,22,120,162,230,117,240,26,164,36,132,248,22,128,22, ! 120,162,230,117,240,26,164,36,133,248,6,120,162,230,117,240,26,164,36,132,248,6,2,18,146, ! 120,164,6,120,162,230,117,240,26,164,36,114,248,230,8,134,7,254,120,162,230,117,240,26,164, ! 36,129,248,230,47,246,24,230,62,246,120,162,230,117,240,26,164,36,128,248,230,8,134,7,120, ! 168,102,254,8,230,98,7,83,6,192,228,78,96,67,120,162,230,117,240,26,164,36,114,248,230, ! 8,134,7,100,128,195,148,128,80,24,120,162,230,117,240,26,164,36,134,248,22,120,162,230,117, ! 240,26,164,36,132,248,22,128,22,120,162,230,117,240,26,164,36,134,248,6,120,162,230,117,240, ! 26,164,36,132,248,6,120,162,230,112,75,120,162,230,117,240,26,164,36,132,248,230,84,3,255, ! 18,4,193,18,184,0,18,194,1,18,204,2,18,214,3,0,0,18,224,194,180,210,179,194,181, ! 210,177,128,30,210,180,194,179,194,181,210,177,128,20,210,180,194,179,210,181,194,177,128,10,194, ! 180,210,179,210,181,194,177,128,0,128,73,120,162,230,117,240,26,164,36,132,248,230,84,3,255, ! 18,4,193,19,3,0,19,13,1,19,23,2,19,33,3,0,0,19,43,194,160,210,161,194,164, ! 210,165,128,30,210,160,194,161,194,164,210,165,128,20,210,160,194,161,210,164,194,165,128,10,194, ! 160,210,161,210,164,194,165,128,0,128,23,120,162,230,112,10,210,180,210,179,210,181,210,177,128, ! 8,210,160,210,161,210,164,210,165,120,162,6,2,17,80,194,134,208,7,208,6,208,5,208,4, ! 208,3,208,2,208,1,208,0,208,240,208,130,208,131,208,224,208,208,50,67,135,128,194,153,117, ! 153,170,117,144,0,117,160,255,117,128,0,18,15,59,18,16,16,120,163,118,0,120,164,118,0, ! 120,90,118,0,120,167,118,0,120,82,118,0,120,82,230,195,148,2,64,3,2,20,99,120,82, ! 230,117,240,26,164,36,110,248,118,7,8,118,208,120,82,230,117,240,26,164,255,123,0,122,0, ! 239,36,114,248,166,2,8,166,3,139,7,138,6,120,82,230,117,240,26,164,36,112,248,166,6, ! 8,166,7,120,82,230,117,240,26,164,255,123,0,239,36,134,248,166,3,139,7,120,82,230,117, ! 240,26,164,36,133,248,166,7,120,82,230,117,240,26,164,36,116,248,228,246,8,246,8,246,8, ! 246,120,82,230,117,240,26,164,36,120,248,228,246,8,246,8,246,8,246,120,82,230,117,240,26, ! 164,36,124,248,228,246,8,246,8,246,8,246,120,82,230,117,240,26,164,36,128,248,228,246,8, ! 246,120,82,230,117,240,26,164,36,130,248,118,3,8,118,232,120,82,230,117,240,26,164,36,132, ! 248,118,0,120,82,230,117,240,26,164,36,135,248,118,0,120,82,6,2,19,146,117,137,1,194, ! 140,117,138,0,117,140,195,210,169,210,175,210,168,144,255,252,224,68,128,240,194,178,194,176,194, ! 162,194,163,120,167,230,96,16,120,167,118,0,120,163,230,120,92,246,120,163,118,0,128,14,120, ! 167,118,1,120,164,230,120,92,246,120,164,118,0,120,90,6,120,90,230,100,50,96,3,2,21, ! 64,144,255,82,224,84,128,112,3,2,21,60,120,82,118,0,120,82,230,195,148,2,80,108,120, ! 83,118,0,120,83,230,195,148,4,80,91,120,82,230,117,240,26,164,36,116,255,228,254,253,120, ! 83,230,251,228,192,5,192,6,192,7,250,127,3,126,0,239,195,155,255,238,154,254,208,3,208, ! 2,208,1,116,1,18,5,250,18,5,135,120,82,230,251,122,0,234,122,2,203,195,51,203,51, ! 218,249,250,235,120,83,38,251,228,58,203,36,96,245,130,235,52,254,245,131,239,240,120,83,6, ! 128,157,120,82,6,128,140,144,255,82,116,16,240,120,90,118,0,120,82,118,0,120,82,230,195, ! 148,2,64,3,2,26,157,120,85,118,2,120,167,230,96,81,120,82,230,117,240,26,164,36,134, ! 248,230,255,51,149,224,254,253,252,120,82,230,117,240,26,164,36,116,251,121,0,144,1,114,18, ! 4,236,120,82,230,117,240,26,164,36,134,248,118,0,120,82,230,117,240,26,164,36,112,248,230, ! 8,134,7,254,51,149,224,253,120,86,246,8,166,5,8,166,6,8,166,7,128,79,120,82,230, ! 117,240,26,164,36,133,248,230,255,51,149,224,254,253,252,120,82,230,117,240,26,164,36,116,251, ! 121,0,144,1,114,18,4,236,120,82,230,117,240,26,164,36,133,248,118,0,120,82,230,117,240, ! 26,164,36,114,248,230,8,134,7,254,51,149,224,253,120,86,246,8,166,5,8,166,6,8,166, ! 7,120,82,230,117,240,26,164,36,116,248,230,8,134,5,8,134,6,8,134,7,252,120,82,230, ! 117,240,26,164,36,120,248,230,8,134,1,8,134,2,8,134,3,248,18,1,130,120,101,166,4, ! 8,166,5,8,166,6,8,166,7,120,101,230,8,70,8,70,8,70,112,3,2,22,222,120,89, ! 134,7,24,134,6,24,134,5,24,134,4,120,89,134,3,24,134,2,24,134,1,24,134,0,18, ! 0,213,18,4,122,123,0,122,0,121,0,120,63,18,1,194,143,3,142,2,141,1,140,0,136, ! 240,120,104,134,7,24,134,6,24,134,5,24,134,4,168,240,18,4,122,236,200,252,237,201,253, ! 238,202,254,239,203,255,18,3,48,18,4,63,120,97,166,4,8,166,5,8,166,6,8,166,7, ! 120,100,134,7,24,134,6,24,134,5,24,134,4,228,251,250,249,248,116,10,18,1,71,112,29, ! 120,100,134,7,24,134,6,24,134,5,24,134,4,18,1,57,120,97,166,4,8,166,5,8,166, ! 6,8,166,7,128,58,120,89,134,7,24,134,6,24,134,5,24,134,4,228,251,250,249,248,116, ! 10,18,1,71,112,4,120,85,118,0,120,89,134,7,24,134,6,24,134,5,24,134,4,228,251, ! 250,249,248,116,6,18,1,71,112,4,120,85,118,1,120,82,230,117,240,26,164,36,130,248,230, ! 8,134,7,254,51,149,224,253,120,105,246,8,166,5,8,166,6,8,166,7,127,5,121,0,123, ! 105,144,1,171,18,4,236,120,104,134,7,24,134,6,24,134,5,24,134,4,228,251,250,249,248, ! 116,6,18,1,71,112,74,120,89,134,7,24,134,6,24,134,5,24,134,4,228,251,250,249,248, ! 116,6,18,1,71,112,6,120,85,118,1,128,43,120,108,134,7,24,134,6,24,134,5,24,134, ! 4,120,100,134,3,24,134,2,24,134,1,24,134,0,116,10,18,1,71,112,6,120,85,118,0, ! 128,4,120,85,118,1,120,104,134,7,24,134,6,24,134,5,24,134,4,228,251,250,249,248,116, ! 10,18,1,71,112,74,120,89,134,7,24,134,6,24,134,5,24,134,4,228,251,250,249,248,116, ! 10,18,1,71,112,6,120,85,118,0,128,43,120,108,134,7,24,134,6,24,134,5,24,134,4, ! 120,100,134,3,24,134,2,24,134,1,24,134,0,116,10,18,1,71,112,6,120,85,118,1,128, ! 4,120,85,118,0,120,82,230,117,240,26,164,36,124,248,230,8,134,5,8,134,6,8,134,7, ! 120,93,246,8,166,5,8,166,6,8,166,7,120,85,230,112,48,120,82,230,117,240,26,164,36, ! 130,248,230,8,134,7,254,120,92,230,251,122,0,18,0,192,238,51,149,224,253,252,120,82,230, ! 117,240,26,164,36,124,251,121,0,144,1,114,18,4,236,120,85,230,20,112,48,120,82,230,117, ! 240,26,164,36,130,248,230,8,134,7,254,120,92,230,251,122,0,18,0,192,238,51,149,224,253, ! 252,120,82,230,117,240,26,164,36,124,251,121,0,144,1,130,18,4,236,120,167,230,112,3,2, ! 25,155,120,82,230,117,240,26,164,36,124,248,230,8,134,5,8,134,6,8,134,7,252,123,10, ! 18,1,147,192,6,192,7,120,96,134,7,24,134,6,24,134,5,24,134,4,123,10,18,1,147, ! 208,224,195,159,255,208,224,158,254,120,82,230,117,240,26,164,36,112,248,230,8,134,3,203,47, ! 255,238,59,254,120,82,230,117,240,26,164,36,114,248,166,6,8,166,7,120,82,230,117,240,26, ! 164,36,114,248,230,8,134,7,254,120,82,230,117,240,26,164,36,110,248,230,8,134,3,211,250, ! 239,155,234,100,128,206,100,128,158,64,32,120,82,230,117,240,26,164,36,110,248,230,8,134,7, ! 254,120,82,230,117,240,26,164,36,114,248,166,6,8,166,7,128,86,120,82,230,117,240,26,164, ! 36,114,248,230,8,134,7,254,120,82,230,117,240,26,164,36,110,248,230,8,134,3,250,195,228, ! 155,251,228,154,195,250,239,155,234,100,128,206,100,128,158,80,37,120,82,230,117,240,26,164,36, ! 110,248,230,8,134,7,254,195,228,159,255,228,158,254,120,82,230,117,240,26,164,36,114,248,166, ! 6,8,166,7,2,26,151,120,82,230,117,240,26,164,36,124,248,230,8,134,5,8,134,6,8, ! 134,7,252,123,10,18,1,147,192,6,192,7,120,96,134,7,24,134,6,24,134,5,24,134,4, ! 123,10,18,1,147,208,224,195,159,255,208,224,158,254,120,82,230,117,240,26,164,36,114,248,230, ! 8,134,3,203,47,255,238,59,254,120,82,230,117,240,26,164,36,112,248,166,6,8,166,7,120, ! 82,230,117,240,26,164,36,112,248,230,8,134,7,254,120,82,230,117,240,26,164,36,110,248,230, ! 8,134,3,211,250,239,155,234,100,128,206,100,128,158,64,32,120,82,230,117,240,26,164,36,110, ! 248,230,8,134,7,254,120,82,230,117,240,26,164,36,112,248,166,6,8,166,7,128,86,120,82, ! 230,117,240,26,164,36,112,248,230,8,134,7,254,120,82,230,117,240,26,164,36,110,248,230,8, ! 134,3,250,195,228,155,251,228,154,195,250,239,155,234,100,128,206,100,128,158,80,37,120,82,230, ! 117,240,26,164,36,110,248,230,8,134,7,254,195,228,159,255,228,158,254,120,82,230,117,240,26, ! 164,36,112,248,166,6,8,166,7,120,82,6,2,21,68,120,92,118,0,144,255,10,224,84,128, ! 112,3,2,28,78,210,140,144,254,32,224,84,7,120,82,246,120,82,230,195,148,2,64,3,2, ! 28,73,120,82,230,117,240,26,164,36,135,248,144,254,33,224,246,120,82,230,117,240,26,164,36, ! 130,248,163,163,224,246,120,82,230,117,240,26,164,36,130,255,228,254,253,143,3,142,2,141,1, ! 144,254,34,224,255,116,1,18,5,41,120,82,230,117,240,26,164,36,130,248,230,84,3,246,120, ! 82,230,117,240,26,164,36,135,248,230,84,1,96,102,120,82,230,117,240,26,164,36,116,248,144, ! 254,39,224,246,120,82,230,117,240,26,164,36,116,255,228,254,253,143,3,142,2,141,1,144,254, ! 38,224,255,116,1,18,5,41,120,82,230,117,240,26,164,36,116,255,228,254,253,143,3,142,2, ! 141,1,144,254,37,224,255,116,2,18,5,41,120,82,230,117,240,26,164,36,116,255,228,254,253, ! 143,3,142,2,141,1,144,254,36,224,255,116,3,18,5,41,144,254,43,224,255,121,0,122,0, ! 123,97,18,5,46,144,254,42,224,255,121,0,122,0,123,98,18,5,46,144,254,41,224,255,121, ! 0,122,0,123,99,18,5,46,144,254,40,224,255,121,0,122,0,123,100,18,5,46,120,82,230, ! 117,240,26,164,36,135,248,230,84,4,96,33,120,82,230,117,240,26,164,36,120,251,121,0,120, ! 100,134,7,24,134,6,24,134,5,24,134,4,144,1,114,18,4,236,128,40,120,82,230,117,240, ! 26,164,255,120,100,134,3,24,134,2,24,134,1,24,134,0,136,240,239,36,120,248,166,240,8, ! 166,1,8,166,2,8,166,3,168,240,120,82,230,117,240,26,164,36,110,248,144,254,45,224,246, ! 120,82,230,117,240,26,164,36,110,255,228,254,253,143,3,142,2,141,1,144,254,44,224,255,116, ! 1,18,5,41,120,82,230,117,240,26,164,36,110,248,230,84,7,246,144,255,10,228,240,2,20, ! 131,42,3,80,0,104,0,105,0,100,0,103,0,101,0,116,0,65,0,100,0,118,0,97,0, ! 110,0,99,0,101,0,100,0,83,0,101,0,114,0,118,0,111,0,18,1,16,1,0,0,0, ! 8,194,6,70,0,0,1,1,2,3,1,28,3,80,0,104,0,105,0,100,0,103,0,101,0, ! 116,0,115,0,32,0,73,0,110,0,99,0,46,0,9,2,32,0,1,1,0,128,50,9,4, ! 0,0,2,255,0,255,0,7,5,1,2,16,0,0,7,5,130,2,16,0,0,}; Index: phidget.c =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/libphidget/phidget.c,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** phidget.c 2 Jul 2003 04:04:45 -0000 1.33 --- phidget.c 4 Jul 2003 22:38:46 -0000 1.34 *************** *** 796,803 **** if (pdt!=NULL) { - DBG("Is this device a phidget? - yes"); int serial=-1; int wasFound=0; // Is this an already attached and used phidget? for (t=0;t<_phidgetDeviceCount;t++) --- 796,804 ---- if (pdt!=NULL) { int serial=-1; int wasFound=0; + DBG("Is this device a phidget? - yes"); + // Is this an already attached and used phidget? for (t=0;t<_phidgetDeviceCount;t++) *************** *** 818,825 **** if (_isSoftPhidget(pdt)) { - DBG(" softphidget found - getting serial new way"); int productID; int Version; struct usb_dev_handle *handle = usb_open(dev); _getSoftPhidgetInfo(&Version,&serial,&productID,handle); usb_close(handle); --- 819,827 ---- if (_isSoftPhidget(pdt)) { int productID; int Version; struct usb_dev_handle *handle = usb_open(dev); + + DBG(" softphidget found - getting serial new way"); _getSoftPhidgetInfo(&Version,&serial,&productID,handle); usb_close(handle); *************** *** 1549,1553 **** buffer[0]=id; // Which servo to control ! buffer[1]=0; // These three didn't seem to do much in the protocol buffer[2]=0; buffer[3]=0; --- 1551,1555 ---- buffer[0]=id; // Which servo to control ! buffer[1]=255; // These three didn't seem to do much in the protocol buffer[2]=0; buffer[3]=0; |
From: Jack S. <js...@us...> - 2003-07-02 04:04:47
|
Update of /cvsroot/libphidget/libphidget/src/libphidget In directory sc8-pr-cvs1:/tmp/cvs-serv20759/libphidget Modified Files: phidget.c Log Message: Re-ordered digital output of the 888 Index: phidget.c =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/libphidget/phidget.c,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** phidget.c 2 Jul 2003 03:59:10 -0000 1.32 --- phidget.c 2 Jul 2003 04:04:45 -0000 1.33 *************** *** 1648,1661 **** return(_error(err)); ! // This weird ordering was used in the 488 phidget ! // so I'm wondering if it is needed for the 888 ! digital[4]=!((buffer[1] & 1)==1); ! digital[5]=!((buffer[1] & 2)==2); ! digital[6]=!((buffer[1] & 4)==4); ! digital[7]=!((buffer[1] & 8)==8); ! digital[3]=!((buffer[1] & 16)==16); ! digital[2]=!((buffer[1] & 32)==32); ! digital[1]=!((buffer[1] & 64)==64); ! digital[0]=!((buffer[1] & 128)==128); --- 1648,1659 ---- return(_error(err)); ! digital[0]=!((buffer[1] & 1)==1); ! digital[1]=!((buffer[1] & 2)==2); ! digital[2]=!((buffer[1] & 4)==4); ! digital[3]=!((buffer[1] & 8)==8); ! digital[4]=!((buffer[1] & 16)==16); ! digital[5]=!((buffer[1] & 32)==32); ! digital[6]=!((buffer[1] & 64)==64); ! digital[7]=!((buffer[1] & 128)==128); *************** *** 1702,1709 **** 12-Bit Sensor values are constructed from the packet as described: ! newSensor[4] = ((unsigned char)Data[2] + ((unsigned char)Data[3] & 0x0f) * 256) * 4; ! newSensor[5] = ((unsigned char)Data[4] + ((unsigned char)Data[3] & 0xf0) * 16) * 4; ! newSensor[6] = ((unsigned char)Data[5] + ((unsigned char)Data[6] & 0x0f) * 256) * 4; ! newSensor[7] = ((unsigned char)Data[7] + ((unsigned char)Data[6] & 0xf0) * 16) * 4; */ --- 1700,1707 ---- 12-Bit Sensor values are constructed from the packet as described: ! newSensor[4] = ((unsigned char)Data[2] + ((unsigned char)Data[3] & 0x0f) * 256) ; ! newSensor[5] = ((unsigned char)Data[4] + ((unsigned char)Data[3] & 0xf0) * 16) ; ! newSensor[6] = ((unsigned char)Data[5] + ((unsigned char)Data[6] & 0x0f) * 256) ; ! newSensor[7] = ((unsigned char)Data[7] + ((unsigned char)Data[6] & 0xf0) * 16) ; */ |
From: Jack S. <js...@us...> - 2003-07-02 03:59:14
|
Update of /cvsroot/libphidget/libphidget/src/libphidget In directory sc8-pr-cvs1:/tmp/cvs-serv20028 Modified Files: phidget.c Log Message: Minor problem with DBG being used before variable declarations. Should help in compiling with more strict compilers Index: phidget.c =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/libphidget/phidget.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** phidget.c 30 Jun 2003 02:49:16 -0000 1.31 --- phidget.c 2 Jul 2003 03:59:10 -0000 1.32 *************** *** 476,480 **** int _getSerial(struct usb_device *device, struct phidget_type *ptd) { - DBG("Get Serial"); int i = 0, j = 0, ret=0; struct usb_dev_handle *handle; --- 476,479 ---- *************** *** 668,672 **** struct usb_device *dev; int ret; - //int t; int vendorID; int productID; --- 667,670 ---- |
From: Jack S. <js...@us...> - 2003-06-30 02:53:30
|
Update of /cvsroot/libphidget/libphidget/src/examples In directory sc8-pr-cvs1:/tmp/cvs-serv9228/examples Modified Files: phidget_c.c Log Message: Added an example in phidget_c to test the reading of the 888 interface kit (assuming the low end library has it working) Index: phidget_c.c =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/examples/phidget_c.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** phidget_c.c 24 Jun 2003 02:43:51 -0000 1.22 --- phidget_c.c 30 Jun 2003 02:53:27 -0000 1.23 *************** *** 25,28 **** --- 25,29 ---- int SERVO8=0; int IK488=0; + int IK888=0; int IKDIGITALWRITE=0; int IK880=0; *************** *** 71,74 **** --- 72,76 ---- printf(" IK488 - test 488 interface kit\n"); printf(" IK880 - test 880 interface kit\n"); + printf(" IK888 - test 888 interface kit\n"); printf(" IKDIGITALWRITE - write data to the 488 or 880 interface kit\n"); printf(" TEXTLCD - test text lcd\n"); *************** *** 90,93 **** --- 92,96 ---- if (strcmp(argv[1],"IK488")==0) IK488=1; if (strcmp(argv[1],"IK880")==0) IK880=1; + if (strcmp(argv[1],"IK888")==0) IK888=1; if (strcmp(argv[1],"IKDIGITALWRITE")==0) IKDIGITALWRITE=1; if (strcmp(argv[1],"TEXTLCD")==0) TEXTLCD=1; *************** *** 222,225 **** --- 225,265 ---- analog[2], analog[3]); + + + } + } + + if (IK888) + if (phidgetTypeDeviceClass (phidgetType (dev)) == LP_INTERFACE_KIT_888) + { + int t,k; + + while(1) + { + float analog[8]; + int digital[8]; + if (phidgetInterfaceKit888Read(dev,analog,digital)<0) + { + printf("error - %s\n",phidgetErrorString(phidgetLastError())); + return(-1); + } + + printf("%c%c%c%c%c%c%c%c %8f %8f %8f %8f %8f %8f %8f %8f\n", + digital[0]==1 ? '*' : '-', + digital[1]==1 ? '*' : '-', + digital[2]==1 ? '*' : '-', + digital[3]==1 ? '*' : '-', + digital[4]==1 ? '*' : '-', + digital[5]==1 ? '*' : '-', + digital[6]==1 ? '*' : '-', + digital[7]==1 ? '*' : '-', + analog[0], + analog[1], + analog[2], + analog[3], + analog[4], + analog[5], + analog[6], + analog[7]); |
From: Jack S. <js...@us...> - 2003-06-30 02:49:19
|
Update of /cvsroot/libphidget/libphidget/src/libphidget In directory sc8-pr-cvs1:/tmp/cvs-serv8769/libphidget Modified Files: SoftPhidget.h phidget.c phidget.h Log Message: Initial checkin of support for the 888 Interface kit. Since I don't have one to test I really doubt this will work. Index: SoftPhidget.h =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/libphidget/SoftPhidget.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SoftPhidget.h 23 Jun 2003 22:37:34 -0000 1.2 --- SoftPhidget.h 30 Jun 2003 02:49:16 -0000 1.3 *************** *** 456,460 **** 50,9,4,0,0,2,255,0,255,0,7,5,1,2,16,0,0,7,5,130,2,32,0,0,}; - #define ANALOG_FIRMWARE_SIZE 3451 const unsigned char ANALOG_FIRMWARE[ANALOG_FIRMWARE_SIZE] = {120, --- 456,459 ---- Index: phidget.c =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/libphidget/phidget.c,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** phidget.c 24 Jun 2003 02:12:13 -0000 1.30 --- phidget.c 30 Jun 2003 02:49:16 -0000 1.31 *************** *** 539,544 **** j=0; - printf("%s ",buffer); - printf("Buffer:%d\n",buffer[0]); for (i=2;i<buffer[0];i+=2) { --- 539,542 ---- *************** *** 934,937 **** --- 932,936 ---- _registerDeviceType("Interface Kit 4/8/8", 0x0925, 0x8201, LP_INTERFACE_KIT_488); _registerDeviceType("Interface Kit 4/8/8", 0x06C2, 0x0040, LP_INTERFACE_KIT_488); + _registerDeviceType("Interface Kit 4/8/8", 0x06C2, 0x0045, LP_INTERFACE_KIT_888); _registerDeviceType("Interface Kit 8/8/0", 0x06C2, 0x0041, LP_INTERFACE_KIT_880); _registerDeviceType("Phidget LCD", 0x06C2, 0x0041, LP_INTERFACE_KIT_880); *************** *** 1519,1522 **** --- 1518,1522 ---- } + // TODO - Still working this one out enum ELPError phidget8Servo(struct phidget *phidgetDevice, int id, float percent, float maxvelocity, float acceleration) { *************** *** 1612,1615 **** --- 1612,1616 ---- return(_error(err)); + // For some reason this weird ordering was needed for the 488 digital[4]=!((buffer[0] & 1)==1); digital[5]=!((buffer[0] & 2)==2); *************** *** 1629,1638 **** } /** ! * Helper function to turn the Text LCD on and configure it */ enum ELPError phidgetInterfaceKitWrite(struct phidget *phidgetDevice, int index, int value) { char buffer[4]; buffer[0] = index+(value << 3); --- 1630,1724 ---- } + /** + * Helper function to read from an interface kit. + */ + enum ELPError phidgetInterfaceKit888Read(struct phidget *phidgetDevice, float analog[8], int digital[8]) + { + int t; + char buffer[8]; + enum ELPError err; + + // Not correct type of interface kit + if (phidgetDevice->type->deviceClass != LP_INTERFACE_KIT_888) + return (_error(LPE_WRONG_PHIDGET_CLASS_TYPE)); + + // Read 2 input packets because 1 isn't large enough all of the data + for (t=0;t<2;t++) + { + err=phidgetRead(phidgetDevice,buffer,sizeof(buffer)); + if (err!=LPE_NONE) + return(_error(err)); + + // This weird ordering was used in the 488 phidget + // so I'm wondering if it is needed for the 888 + digital[4]=!((buffer[1] & 1)==1); + digital[5]=!((buffer[1] & 2)==2); + digital[6]=!((buffer[1] & 4)==4); + digital[7]=!((buffer[1] & 8)==8); + digital[3]=!((buffer[1] & 16)==16); + digital[2]=!((buffer[1] & 32)==32); + digital[1]=!((buffer[1] & 64)==64); + digital[0]=!((buffer[1] & 128)==128); + + + if (!(buffer[0] & 0x01)) + { + // Read first section + analog[0]=((unsigned char)buffer[2]+((unsigned char)buffer[3] & 0x0f) * 256); + analog[1]=((unsigned char)buffer[4]+((unsigned char)buffer[3] & 0xf0) * 16); + analog[2]=((unsigned char)buffer[5]+((unsigned char)buffer[6] & 0x0f) * 256); + analog[3]=((unsigned char)buffer[7]+((unsigned char)buffer[6] & 0xf0) * 16); + } + else + { + // Read second section + analog[4]=((unsigned char)buffer[2]+((unsigned char)buffer[3] & 0x0f) * 256); + analog[5]=((unsigned char)buffer[4]+((unsigned char)buffer[3] & 0xf0) * 16); + analog[6]=((unsigned char)buffer[5]+((unsigned char)buffer[6] & 0x0f) * 256); + analog[7]=((unsigned char)buffer[7]+((unsigned char)buffer[6] & 0xf0) * 16); + } + } + + /* + New Packet format + + Input Packet Length: 8 Bytes + + The current state of this PhidgetInterfaceKit is too large to fit into a single packet. + So Bit 1 of Byte 0 indicates whether this is a Packet.0 or Packet.1 + + In the case of Packet.0 (!(Byte_0 & 0x01)), this is the assignments. + + Input_State 0-7 map onto Byte 1, bits 0-7, as shown. m_inputvalue = Data[1]; + + 12-Bit Sensor values are constructed from the packet as described: + newSensor[0] = ((unsigned char)Data[2] + ((unsigned char)Data[3] & 0x0f) * 256); + newSensor[1] = ((unsigned char)Data[4] + ((unsigned char)Data[3] & 0xf0) * 16); + newSensor[2] = ((unsigned char)Data[5] + ((unsigned char)Data[6] & 0x0f) * 256); + newSensor[3] = ((unsigned char)Data[7] + ((unsigned char)Data[6] & 0xf0) * 16); + + + In the case of Packet.1 (Byte_0 & 0x01), this is the assignments. + + Input_State 0-7 map onto Byte 1, bits 0-7, as shown. m_inputvalue = Data[1]; + + 12-Bit Sensor values are constructed from the packet as described: + newSensor[4] = ((unsigned char)Data[2] + ((unsigned char)Data[3] & 0x0f) * 256) * 4; + newSensor[5] = ((unsigned char)Data[4] + ((unsigned char)Data[3] & 0xf0) * 16) * 4; + newSensor[6] = ((unsigned char)Data[5] + ((unsigned char)Data[6] & 0x0f) * 256) * 4; + newSensor[7] = ((unsigned char)Data[7] + ((unsigned char)Data[6] & 0xf0) * 16) * 4; + */ + + return (_error(LPE_NONE)); + } + /** ! * Helper function to write to an interface kit */ enum ELPError phidgetInterfaceKitWrite(struct phidget *phidgetDevice, int index, int value) { char buffer[4]; + + // TODO - This doesn't work for the 888 yet, need to rework some internal data structures to get it working. buffer[0] = index+(value << 3); Index: phidget.h =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/libphidget/phidget.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** phidget.h 23 Jun 2003 22:37:34 -0000 1.22 --- phidget.h 30 Jun 2003 02:49:16 -0000 1.23 *************** *** 82,85 **** --- 82,86 ---- LP_INTERFACE_KIT_880 = 301, //!< 880 interface kit LP_INTERFACE_KIT_488 = 302, //!< 488 interface kit + LP_INTERFACE_KIT_888 = 303, //!< 888 interface kit LP_ENCODER = 400, //!< Currently unsupported LP_POWER = 500, //!< PhidgetPower *************** *** 294,297 **** --- 295,307 ---- struct phidget *phidgetDevice, //!< The phidget to read from float analog[4], //!< This will be filled with the value of the four analog inputs + int digital[8] //!< This iwll be filled with the value of the four digital inputs. 1 is on, 0 is off. + ); + + /** + * Reads a 8/8/8 interface kit + */ + enum ELPError phidgetInterfaceKit888Read( + struct phidget *phidgetDevice, //!< The phidget to read from + float analog[8], //!< This will be filled with the value of the four analog inputs int digital[8] //!< This iwll be filled with the value of the four digital inputs. 1 is on, 0 is off. ); |
From: Jack S. <js...@us...> - 2003-06-24 02:43:55
|
Update of /cvsroot/libphidget/libphidget/src/examples In directory sc8-pr-cvs1:/tmp/cvs-serv20190/src/examples Modified Files: phidget_c.c Log Message: Initial support for the 8 way advanced servo in phidget++, not fully tested yet. Index: phidget_c.c =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/examples/phidget_c.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** phidget_c.c 24 Jun 2003 02:12:13 -0000 1.21 --- phidget_c.c 24 Jun 2003 02:43:51 -0000 1.22 *************** *** 144,147 **** --- 144,148 ---- ) { + printf("Servo Test\n"); for (k = 0; k < 1; k += .1) { |
From: Jack S. <js...@us...> - 2003-06-24 02:43:54
|
Update of /cvsroot/libphidget/libphidget/src/phidget++ In directory sc8-pr-cvs1:/tmp/cvs-serv20190/src/phidget++ Modified Files: CPhidgetManager.cc CServoController.cc Log Message: Initial support for the 8 way advanced servo in phidget++, not fully tested yet. Index: CPhidgetManager.cc =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CPhidgetManager.cc,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** CPhidgetManager.cc 23 Dec 2002 04:38:40 -0000 1.16 --- CPhidgetManager.cc 24 Jun 2003 02:43:51 -0000 1.17 *************** *** 93,96 **** --- 93,97 ---- if (tp==LP_SERVO_CONTROLLER && dc==LP_UNI_SERVO) devices.insert(temp_uid); if (tp==LP_SERVO_CONTROLLER && dc==LP_QUAD_SERVO) devices.insert(temp_uid); + if (tp==LP_SERVO_CONTROLLER && dc==LP_8WAY_SERVO) devices.insert(temp_uid); } *************** *** 224,228 **** case LP_UNI_SERVO: case LP_QUAD_SERVO: ! //case LP_8WAY_SERVO: { CServoController *sc = new CServoController (uid); --- 225,229 ---- case LP_UNI_SERVO: case LP_QUAD_SERVO: ! case LP_8WAY_SERVO: { CServoController *sc = new CServoController (uid); Index: CServoController.cc =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CServoController.cc,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** CServoController.cc 23 Dec 2002 04:38:40 -0000 1.10 --- CServoController.cc 24 Jun 2003 02:43:51 -0000 1.11 *************** *** 35,43 **** break; } ! //case LP_8WAY_SERVO: ! //{ ! //setServoCount(8); ! //break; ! //} default: throw runtime_error("Can't initialize a CServoController with a phidget that is not a servo controller"); --- 35,43 ---- break; } ! case LP_8WAY_SERVO: ! { ! setServoCount(8); ! break; ! } default: throw runtime_error("Can't initialize a CServoController with a phidget that is not a servo controller"); *************** *** 189,192 **** --- 189,231 ---- error(phidgetQuadServo(device(), p1, p2, p3, p4)); + } + else + if (_servoCount==8) + { + float p1 = 0, p2 = 0, p3 = 0, p4 = 0; + float p5 = 0, p6 = 0, p7 = 0, p8 = 0; + + if (_servoCount >= 1 && _servos[0].second != NULL) + p1 = _servos[0].second->position(); + + if (_servoCount >= 2 && _servos[1].second != NULL) + p2 = _servos[1].second->position(); + + if (_servoCount >= 3 && _servos[2].second != NULL) + p3 = _servos[2].second->position(); + + if (_servoCount >= 4 && _servos[3].second != NULL) + p4 = _servos[3].second->position(); + + if (_servoCount >= 5 && _servos[4].second != NULL) + p5 = _servos[4].second->position(); + + if (_servoCount >= 6 && _servos[5].second != NULL) + p6 = _servos[5].second->position(); + + if (_servoCount >= 7 && _servos[6].second != NULL) + p7 = _servos[6].second->position(); + + if (_servoCount >= 8 && _servos[7].second != NULL) + p8 = _servos[7].second->position(); + + phidget8Servo(device(),0,p1,0,0); + phidget8Servo(device(),1,p2,0,0); + phidget8Servo(device(),2,p3,0,0); + phidget8Servo(device(),3,p4,0,0); + phidget8Servo(device(),4,p5,0,0); + phidget8Servo(device(),5,p6,0,0); + phidget8Servo(device(),6,p7,0,0); + phidget8Servo(device(),7,p8,0,0); } METHOD_UNGUARD; |
From: Jack S. <js...@us...> - 2003-06-24 02:12:16
|
Update of /cvsroot/libphidget/libphidget/src/libphidget In directory sc8-pr-cvs1:/tmp/cvs-serv16539/src/libphidget Modified Files: phidget.c Log Message: Removed debugging statements and various cleanups Index: phidget.c =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/libphidget/phidget.c,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** phidget.c 23 Jun 2003 22:47:02 -0000 1.29 --- phidget.c 24 Jun 2003 02:12:13 -0000 1.30 *************** *** 22,27 **** // TODO - change this ! #define DBG(a) printf("*** DEBUG *** : %s\n",a) ! //#define DBG(a) int _libPhidgetInitialized = 0; /**< Private variable to determine if the libphidget is initialized */ --- 22,27 ---- // TODO - change this ! //#define DBG(a) printf("*** DEBUG *** : %s\n",a) ! #define DBG(a) int _libPhidgetInitialized = 0; /**< Private variable to determine if the libphidget is initialized */ *************** *** 549,554 **** j++; - printf("Serial:[%s]\n",serial); - usb_release_interface(handle, 0); usb_close(handle); --- 549,552 ---- *************** *** 700,707 **** DBG(" softphidget found"); - //printf("Bus:0x0%x Dev:0x0%x\n",bus,dev); _getSoftPhidgetInfo(&Version,&SerialNumber,&productID,handle); ! printf("Version:%d Serial:%d ProductID:0x0%x\n",Version,SerialNumber,productID); //_addNewSerial(bus,dev,SerialNumber); --- 698,704 ---- DBG(" softphidget found"); _getSoftPhidgetInfo(&Version,&SerialNumber,&productID,handle); ! //printf("Version:%d Serial:%d ProductID:0x0%x\n",Version,SerialNumber,productID); //_addNewSerial(bus,dev,SerialNumber); *************** *** 823,827 **** if (wasFound==0) { - printf("Bus:0x0%x Dev:0x0%x\n",bus,dev); if (_isSoftPhidget(pdt)) { --- 820,823 ---- *************** *** 838,843 **** serial=_getSerial(dev,pdt); } - - printf(" Serial:%d\n",serial); // have we seen this phidget before --- 834,837 ---- |
From: Jack S. <js...@us...> - 2003-06-24 02:12:16
|
Update of /cvsroot/libphidget/libphidget/src/examples In directory sc8-pr-cvs1:/tmp/cvs-serv16539/src/examples Modified Files: phidget_c.c Log Message: Removed debugging statements and various cleanups Index: phidget_c.c =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/examples/phidget_c.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** phidget_c.c 23 Jun 2003 22:37:34 -0000 1.20 --- phidget_c.c 24 Jun 2003 02:12:13 -0000 1.21 *************** *** 100,103 **** --- 100,104 ---- unsigned char buffer[6]; float k; + int i; struct phidget *dev = phidgetOpen (phidgets[t]); // Open the phidget #t *************** *** 145,152 **** for (k = 0; k < 1; k += .1) { ! int i; ! printf ("%f\n",k); ! // Move a single servo (will move if (SERVO1) --- 146,152 ---- for (k = 0; k < 1; k += .1) { ! printf ("Rotating %3.2f%%\n",k*100); ! // Move a single servo if (SERVO1) *************** *** 183,186 **** --- 183,193 ---- // Process any events that have occured, like attach/detach phidgetEvents (); + } + + for (i=0;i<8;i++) + if (phidget8Servo (dev, i,0,.1,.1)<0) + { + printf("error - %s\n",phidgetErrorString(phidgetLastError())); + return(9); } } |
From: Jack S. <js...@us...> - 2003-06-23 22:47:05
|
Update of /cvsroot/libphidget/libphidget/src/libphidget In directory sc8-pr-cvs1:/tmp/cvs-serv25891/src/libphidget Modified Files: phidget.c Log Message: Fixed problem with softphidget/regular phidgets not working together, now they should all play nicely Index: phidget.c =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/libphidget/phidget.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** phidget.c 23 Jun 2003 22:37:34 -0000 1.28 --- phidget.c 23 Jun 2003 22:47:02 -0000 1.29 *************** *** 144,148 **** * Test if the phidget type is a soft phidget */ ! int _isSoftPhidget(struct phidget_type *pdt) { switch(pdt->productID) --- 144,148 ---- * Test if the phidget type is a soft phidget */ ! int _isSoftPhidget(const struct phidget_type *pdt) { switch(pdt->productID) *************** *** 1205,1208 **** --- 1205,1209 ---- int a,b; int ret; + DBG("phidgetWrite"); if (_libPhidgetInitialized == 0) *************** *** 1215,1222 **** return (_error(LPE_PHIDGET_NOT_OPENED)); ! ! // If this isn't a soft phidget we use control messages so ! /* ! ret=usb_control_msg(phidgetDevice->handle, 0x21, 0x09, 0x200, 0, buffer, size, 5000); if (ret!=size) --- 1216,1229 ---- return (_error(LPE_PHIDGET_NOT_OPENED)); ! if (_isSoftPhidget(phidgetType(phidgetDevice))==0) ! { ! // If this isn't a soft phidget we use control messages so ! ret=usb_control_msg(phidgetDevice->handle, 0x21, 0x09, 0x200, 0, buffer, size, 5000); ! } ! else ! { ! // Only works for writing to soft phidgets ! ret=usb_bulk_write(phidgetDevice->handle, 0x01, (void *)buffer,size, 5000); ! } if (ret!=size) *************** *** 1227,1280 **** return (_error(LPE_CONTROL_MSG_ERROR)); } - */ - - - // Only works for writing to soft phidgets - ret=usb_bulk_write(phidgetDevice->handle, 0x01, (void *)buffer,size, 5000); - printf("%d\n",ret); - - - // Keep trying - //ret=usb_control_msg(phidgetDevice->handle, 0x21, 0x09, 0x200, 0, buffer, size, 5000); - - //for (a=0;a<255;a++) - //for (b=0;b<255;b++) - //{ - //ret=usb_control_msg(phidgetDevice->handle, a, b, 0x200, 0, buffer, size, 5000); - //if (ret!=-1) - //printf("%d %d %d\n",a,b,ret); - //} - //exit(-1); - - - //128 6 16 - //ret=usb_control_msg(phidgetDevice->handle, 0x21, 0x09, 0x200, 0, buffer, size, 5000); - //ret=usb_control_msg(phidgetDevice->handle, 128, 6, 0x200, 0, buffer, size, 5000); - - - /* - sizeleft=size; - wrote=0; - - while (sizeleft>0) - { - printf("Try to write %d\n",sizeleft); - ret=usb_bulk_write(phidgetDevice->handle, 0x01, (void *)(buffer+wrote),sizeleft, 5000); - - if (ret!=-1) - { - if (ret<0) - { - char temp[64]; - sprintf(temp,"Tried to write %d, but got error %d\n",size,ret); - DBG(temp); - return (_error(LPE_CONTROL_MSG_ERROR)); - } - - sizeleft-=ret; - wrote+=ret; - } - } - */ --- 1234,1237 ---- |
From: Jack S. <js...@us...> - 2003-06-23 22:37:37
|
Update of /cvsroot/libphidget/libphidget/src/examples In directory sc8-pr-cvs1:/tmp/cvs-serv24449/src/examples Modified Files: phidget_c.c Log Message: Added support for the Power phidget along with initial support for the AdvancedServo soft phidget. Currently regular phidgets don't work though. Index: phidget_c.c =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/examples/phidget_c.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** phidget_c.c 23 Dec 2002 04:38:39 -0000 1.19 --- phidget_c.c 23 Jun 2003 22:37:34 -0000 1.20 *************** *** 28,31 **** --- 28,32 ---- int IK880=0; int TEXTLCD=0; + int POWER=0; // Initialize libphiget, here is where the devices are actually retrieved by the library *************** *** 58,62 **** printf("Phidget Name ID ID Serial#\n"); printf("-------------------------------- ------ ------- -------\n"); ! printf ("%32s 0x0%x 0x0%x %06d\n", phidgetTypeName (phidgetType (dev)), phidgetTypeVendorID (phidgetType (dev)), --- 59,63 ---- printf("Phidget Name ID ID Serial#\n"); printf("-------------------------------- ------ ------- -------\n"); ! printf ("%32s 0x0%x 0x0%x %06d\n", phidgetTypeName (phidgetType (dev)), phidgetTypeVendorID (phidgetType (dev)), *************** *** 72,75 **** --- 73,77 ---- printf(" IKDIGITALWRITE - write data to the 488 or 880 interface kit\n"); printf(" TEXTLCD - test text lcd\n"); + printf(" POWER - test power phidget\n"); *************** *** 90,93 **** --- 92,96 ---- if (strcmp(argv[1],"IKDIGITALWRITE")==0) IKDIGITALWRITE=1; if (strcmp(argv[1],"TEXTLCD")==0) TEXTLCD=1; + if (strcmp(argv[1],"POWER")==0) POWER=1; } *************** *** 97,100 **** --- 100,104 ---- unsigned char buffer[6]; float k; + struct phidget *dev = phidgetOpen (phidgets[t]); // Open the phidget #t *************** *** 135,139 **** if ( (SERVO1 && phidgetTypeDeviceClass (phidgetType (dev)) == LP_UNI_SERVO) || ! (SERVO4 && phidgetTypeDeviceClass (phidgetType (dev)) == LP_QUAD_SERVO) ) { --- 139,144 ---- if ( (SERVO1 && phidgetTypeDeviceClass (phidgetType (dev)) == LP_UNI_SERVO) || ! (SERVO4 && phidgetTypeDeviceClass (phidgetType (dev)) == LP_QUAD_SERVO) || ! (SERVO8 && phidgetTypeDeviceClass (phidgetType (dev)) == LP_8WAY_SERVO) ) { *************** *** 159,163 **** { printf("error - %s\n",phidgetErrorString(phidgetLastError())); ! return(5); } } --- 164,178 ---- { printf("error - %s\n",phidgetErrorString(phidgetLastError())); ! return(6); ! } ! } ! ! if (SERVO8) ! { ! for (i=0;i<8;i++) ! if (phidget8Servo (dev, i,k,.1,.1)<0) ! { ! printf("error - %s\n",phidgetErrorString(phidgetLastError())); ! return(7); } } *************** *** 263,266 **** --- 278,296 ---- } } + if (POWER) + if (phidgetTypeDeviceClass (phidgetType (dev)) == LP_POWER) + { + char temp[1024]; + phidgetPower(dev,0,1,0); + phidgetPower(dev,1,50000,50000); + + printf("Setting power phidget at holding, press enter to turn off\n"); + getchar(); + + phidgetPower(dev,0,0,1); + phidgetPower(dev,1,0,1); + } + else + printf("Not a power phidget\n"); // Close the phidget *************** *** 268,272 **** { printf("error - %s\n",phidgetErrorString(phidgetLastError())); ! return(6); } --- 298,302 ---- { printf("error - %s\n",phidgetErrorString(phidgetLastError())); ! return(8); } |
From: Jack S. <js...@us...> - 2003-06-23 22:37:37
|
Update of /cvsroot/libphidget/libphidget/src/libphidget In directory sc8-pr-cvs1:/tmp/cvs-serv24449/src/libphidget Modified Files: SoftPhidget.h phidget.c phidget.h Log Message: Added support for the Power phidget along with initial support for the AdvancedServo soft phidget. Currently regular phidgets don't work though. Index: SoftPhidget.h =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/libphidget/SoftPhidget.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SoftPhidget.h 16 Dec 2002 21:26:29 -0000 1.1 --- SoftPhidget.h 23 Jun 2003 22:37:34 -0000 1.2 *************** *** 1,672 **** ! int SOFT_SERVO8_SIZE=7510; ! const unsigned char SOFT_SERVO8_CODE[7510] = {0x53, ! 0x1d,0x6e,0x2,0x0,0xe,0x2,0x10,0xcb,0x0,0x0,0x0,0x0,0x0,0x2,0x11,0x8d,0x75,0x81,0x7a,0x78,0x7a,0x76,0x0,0xd8,0xfc, ! 0x90,0x0,0x0,0xae,0x83,0xaf,0x82,0x90,0x0,0x0,0x12,0x0,0x4c,0x60,0x5,0xe4,0xf0,0xa3,0x80,0xf6,0x90,0x0,0xaa,0x12,0x0, ! 0x55,0x90,0x0,0xae,0x12,0x0,0x55,0x90,0x0,0xb2,0x12,0x0,0x73,0x90,0x0,0xb8,0x12,0x0,0x73,0x75,0xd0,0x0,0x12,0x11,0xad, ! 0x2,0x0,0xbe,0xef,0x65,0x82,0x70,0x3,0xee,0x65,0x83,0x22,0xe4,0x93,0xf8,0x74,0x1,0x93,0xf9,0x74,0x2,0x93,0xfe,0x74,0x3, ! 0x93,0xf5,0x82,0x8e,0x83,0xe8,0x69,0x70,0x1,0x22,0xe4,0x93,0xf6,0xa3,0x8,0x80,0xf4,0xe4,0x93,0xfc,0x74,0x1,0x93,0xfd,0x74, ! 0x2,0x93,0xfe,0x74,0x3,0x93,0xff,0x74,0x4,0x93,0xf8,0x74,0x5,0x93,0xf5,0x82,0x88,0x83,0x12,0x0,0x4c,0x70,0x1,0x22,0xe4, ! 0x93,0xa3,0xa8,0x83,0xa9,0x82,0x8c,0x83,0x8d,0x82,0xf0,0xa3,0xac,0x83,0xad,0x82,0x88,0x83,0x89,0x82,0x80,0xe3,0x30,0x30,0x6, ! 0x5c,0x7b,0x7b,0x6,0x5c,0x0,0x0,0x6,0x5c,0x6,0x5c,0x0,0x0,0x6,0x5c,0x6,0x5c,0x80,0xfe,0xec,0x4d,0x70,0x1,0x22,0xe8, [...1874 lines suppressed...] + 84,32,96,6,120,75,230,68,4,246,120,74,230,84,64,96,6,120,75,230,68,2,246,120,74, + 230,84,128,96,6,120,75,230,68,1,246,120,73,230,6,255,120,75,134,3,239,36,93,248,166, + 3,120,72,230,195,51,246,24,230,51,246,2,12,198,34,117,137,32,67,135,128,117,141,243,117, + 152,64,194,153,117,153,170,210,142,117,144,255,117,160,255,117,176,255,117,128,255,120,90,118,1, + 120,82,118,0,120,82,230,195,148,32,80,21,120,82,230,36,93,248,118,0,120,82,230,36,125, + 248,118,0,120,82,6,128,227,18,10,81,18,11,38,144,254,233,224,255,126,0,144,254,232,224, + 251,122,0,139,2,228,120,92,47,246,238,58,24,246,210,175,210,168,144,255,252,224,68,128,240, + 120,92,230,112,3,24,230,20,112,5,18,12,187,128,3,18,12,93,120,82,118,0,120,82,230, + 195,148,32,80,27,120,82,230,36,93,248,230,255,120,82,230,36,125,248,230,111,96,4,120,90, + 118,1,120,82,6,128,221,120,90,230,20,112,73,144,255,82,224,84,128,96,65,120,82,118,0, + 120,82,230,195,148,32,80,43,120,82,230,36,93,248,230,255,120,82,230,36,96,245,130,228,52, + 254,245,131,239,240,120,82,230,36,93,248,230,255,120,82,230,36,125,248,166,7,120,82,6,128, + 205,144,255,82,116,32,240,120,90,118,0,2,13,245,40,3,80,0,104,0,105,0,100,0,103, + 0,101,0,116,0,73,0,110,0,116,0,101,0,114,0,102,0,97,0,99,0,101,0,75,0, + 105,0,116,0,18,1,16,1,0,0,0,8,194,6,67,0,0,5,1,2,3,1,28,3,80, + 0,104,0,105,0,100,0,103,0,101,0,116,0,115,0,32,0,73,0,110,0,99,0,46,0, + 9,2,32,0,1,1,0,128,50,9,4,0,0,2,255,0,255,0,7,5,1,2,64,0,0, + 7,5,130,2,32,0,0,}; Index: phidget.c =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/libphidget/phidget.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** phidget.c 23 Dec 2002 04:38:40 -0000 1.27 --- phidget.c 23 Jun 2003 22:37:34 -0000 1.28 *************** *** 22,27 **** // TODO - change this ! //#define DBG(a) printf("*** DEBUG *** : %s\n",a) ! #define DBG(a) int _libPhidgetInitialized = 0; /**< Private variable to determine if the libphidget is initialized */ --- 22,27 ---- // TODO - change this ! #define DBG(a) printf("*** DEBUG *** : %s\n",a) ! //#define DBG(a) int _libPhidgetInitialized = 0; /**< Private variable to determine if the libphidget is initialized */ *************** *** 48,51 **** --- 48,52 ---- * - Interface Kit 488 Digital Input only HID * - Interface Kit 880 Digital Input only HID + * - PhidgetPower Ver 1.01 Supported * - Interface Kit 32-32-0 Not supported yet * - Interface Kit 0-256-0 Not supported yet *************** *** 53,57 **** * - PhidgetLED Ver 1.0 Not supported yet * - PhidgetEncoder Ver 1.0 Not supported yet - * - PhidgetPower Ver 1.01 Not supported yet * - PhidgetTextLCD ECMA1010 Ver 1.0 Not supported yet * - PhidgetGraphicLCD Ver 1.0 Not supported yet --- 54,57 ---- *************** *** 199,203 **** * An array of serial holders */ ! struct SerialHolder *Serials=NULL; /** --- 199,203 ---- * An array of serial holders */ ! //struct SerialHolder *Serials=NULL; /** *************** *** 211,214 **** --- 211,215 ---- * the attach/detachment of phidgets */ + /* void _addNewSerial(struct usb_bus *bus,struct usb_device *device,int SerialNumber) { *************** *** 233,236 **** --- 234,238 ---- Serials[SerialCount-1].serial=SerialNumber; } + */ /* *************** *** 474,477 **** --- 476,480 ---- int _getSerial(struct usb_device *device, struct phidget_type *ptd) { + DBG("Get Serial"); int i = 0, j = 0, ret=0; struct usb_dev_handle *handle; *************** *** 522,525 **** --- 525,533 ---- } + for (i=0;i<128;i++) + { + buffer[i]=0; + serial[i]=0; + } i=usb_control_msg(handle, 0x80, 0x06, 0x0303, 0, buffer, sizeof(buffer), 5000); if (i!=buffer[0] || i<0) *************** *** 531,534 **** --- 539,544 ---- j=0; + printf("%s ",buffer); + printf("Buffer:%d\n",buffer[0]); for (i=2;i<buffer[0];i+=2) { *************** *** 539,542 **** --- 549,554 ---- j++; + printf("Serial:[%s]\n",serial); + usb_release_interface(handle, 0); usb_close(handle); *************** *** 596,600 **** } - /* void _getSoftPhidgetInfo(int *Version,int *SerialNumber,int *productID,struct usb_dev_handle *handle) { --- 608,611 ---- *************** *** 692,697 **** _getSoftPhidgetInfo(&Version,&SerialNumber,&productID,handle); ! //printf("Version:%d Serial:%d ProductID:0x0%x\n",Version,SerialNumber,productID); ! _addNewSerial(bus,dev,SerialNumber); switch(productID) --- 703,708 ---- _getSoftPhidgetInfo(&Version,&SerialNumber,&productID,handle); ! printf("Version:%d Serial:%d ProductID:0x0%x\n",Version,SerialNumber,productID); ! //_addNewSerial(bus,dev,SerialNumber); switch(productID) *************** *** 702,705 **** --- 713,717 ---- if (usb_bulk_write(handle, 0x01, (void *)SOFT_SERVO8_CODE,SOFT_SERVO8_SIZE, 5000) != SOFT_SERVO8_SIZE) { + printf("Error, can't write firmware\n"); exit(-1); } *************** *** 711,714 **** --- 723,729 ---- usb_close(handle); + + DBG("Waiting for reboot"); + sleep(1); } } *************** *** 717,721 **** return(_error(LPE_NONE)); } - */ /** --- 732,735 ---- *************** *** 753,757 **** // Not supported yet ! //_checkForSoftPhidgets(); // We need to detect: --- 767,774 ---- // Not supported yet ! if (_checkForSoftPhidgets()!=LPE_NONE) ! return(0); ! ! // We need to detect: *************** *** 763,767 **** ! // Initilize the "found it" array to NOT_FOUND for (t = 0; t < _phidgetDeviceCount; t++) found[t] = NOT_FOUND; --- 780,784 ---- ! // Initialize the "found it" array to NOT_FOUND for (t = 0; t < _phidgetDeviceCount; t++) found[t] = NOT_FOUND; *************** *** 773,779 **** --- 790,798 ---- // Go thru all USB busses + DBG("Going thru all USB Busses"); for (bus = usb_busses; bus; bus = bus->next) { // Step thru each device on that bus + DBG("Going thru each device on that bus"); for (dev = bus->devices; dev; dev = dev->next) { *************** *** 784,787 **** --- 803,807 ---- if (pdt!=NULL) { + DBG("Is this device a phidget? - yes"); int serial=-1; int wasFound=0; *************** *** 803,817 **** if (wasFound==0) { ! //printf("Bus:0x0%x Dev:0x0%x\n",bus,dev); ! /* if (_isSoftPhidget(pdt)) { ! serial=0;//_getSoftSerial(bus,dev); } else ! */ ! serial=_getSerial(dev,pdt); ! //printf(" Serial:%d\n",serial); // have we seen this phidget before --- 823,843 ---- if (wasFound==0) { ! printf("Bus:0x0%x Dev:0x0%x\n",bus,dev); if (_isSoftPhidget(pdt)) { ! DBG(" softphidget found - getting serial new way"); ! int productID; ! int Version; ! struct usb_dev_handle *handle = usb_open(dev); ! _getSoftPhidgetInfo(&Version,&serial,&productID,handle); ! usb_close(handle); } else ! { ! DBG(" getting serial old fashioned way\n"); ! serial=_getSerial(dev,pdt); ! } ! printf(" Serial:%d\n",serial); // have we seen this phidget before *************** *** 844,850 **** --- 870,879 ---- } } + else + DBG("Is this device a phidget? - no"); } } + DBG("Going thru phidgets"); for (t=0;t<_phidgetDeviceCount;t++) { *************** *** 888,892 **** } - return(change); } --- 917,920 ---- *************** *** 916,920 **** _registerDeviceType("PhidgetTextLCD ECMA1010 Ver 1.0", 0x06C2, 0x0050,LP_TEXT_LCD); //_registerDeviceType("RFID VID/PID", 0x06C2, 0x0030, LP_OTHER); ! //_registerDeviceType("8-AdvancedServo", 0x06C2, 0x003B, LP_8WAY_SERVO); //_registerDeviceType("Interface Kit 32-32-0", 0x06C2, 0x0042, LP_INTERFACE_KIT); //_registerDeviceType("Interface Kit 0-256-0", 0x06C2, 0x0043, LP_INTERFACE_KIT); --- 944,948 ---- _registerDeviceType("PhidgetTextLCD ECMA1010 Ver 1.0", 0x06C2, 0x0050,LP_TEXT_LCD); //_registerDeviceType("RFID VID/PID", 0x06C2, 0x0030, LP_OTHER); ! _registerDeviceType("8-AdvancedServo", 0x06C2, 0x003B, LP_8WAY_SERVO); //_registerDeviceType("Interface Kit 32-32-0", 0x06C2, 0x0042, LP_INTERFACE_KIT); //_registerDeviceType("Interface Kit 0-256-0", 0x06C2, 0x0043, LP_INTERFACE_KIT); *************** *** 922,928 **** //_registerDeviceType("PhidgetLED Ver 1.0", 0x06C2, 0x0049, LP_OTHER); //_registerDeviceType("PhidgetEncoder Ver 1.0", 0x06C2, 0x004B, LP_OTHER); ! //_registerDeviceType("PhidgetPower Ver 1.01", 0x06C2, 0x004E, LP_OTHER); //_registerDeviceType("PhidgetGraphicLCD Ver 1.0", 0x06C2, 0x0058, LP_OTHER); ! //_registerDeviceType("SoftPhidget", 0x06C2, 0x0060, LP_OTHER); _libPhidgetInitialized = 1; --- 950,956 ---- //_registerDeviceType("PhidgetLED Ver 1.0", 0x06C2, 0x0049, LP_OTHER); //_registerDeviceType("PhidgetEncoder Ver 1.0", 0x06C2, 0x004B, LP_OTHER); ! _registerDeviceType("PhidgetPower Ver 1.01", 0x06C2, 0x004E, LP_POWER); //_registerDeviceType("PhidgetGraphicLCD Ver 1.0", 0x06C2, 0x0058, LP_OTHER); ! _registerDeviceType("SoftPhidget", 0x06C2, 0x0060, LP_OTHER); _libPhidgetInitialized = 1; *************** *** 1174,1177 **** --- 1202,1207 ---- enum ELPError phidgetWrite(struct phidget *phidgetDevice, char *buffer, int size) { + int sizeleft,wrote; + int a,b; int ret; DBG("phidgetWrite"); *************** *** 1185,1191 **** --- 1215,1291 ---- return (_error(LPE_PHIDGET_NOT_OPENED)); + + // If this isn't a soft phidget we use control messages so + /* ret=usb_control_msg(phidgetDevice->handle, 0x21, 0x09, 0x200, 0, buffer, size, 5000); + if (ret!=size) + { + char temp[64]; + sprintf(temp,"Tried to write %d, but got error %d\n",size,ret); + DBG(temp); return (_error(LPE_CONTROL_MSG_ERROR)); + } + */ + + + // Only works for writing to soft phidgets + ret=usb_bulk_write(phidgetDevice->handle, 0x01, (void *)buffer,size, 5000); + printf("%d\n",ret); + + + // Keep trying + //ret=usb_control_msg(phidgetDevice->handle, 0x21, 0x09, 0x200, 0, buffer, size, 5000); + + //for (a=0;a<255;a++) + //for (b=0;b<255;b++) + //{ + //ret=usb_control_msg(phidgetDevice->handle, a, b, 0x200, 0, buffer, size, 5000); + //if (ret!=-1) + //printf("%d %d %d\n",a,b,ret); + //} + //exit(-1); + + + //128 6 16 + //ret=usb_control_msg(phidgetDevice->handle, 0x21, 0x09, 0x200, 0, buffer, size, 5000); + //ret=usb_control_msg(phidgetDevice->handle, 128, 6, 0x200, 0, buffer, size, 5000); + + + /* + sizeleft=size; + wrote=0; + + while (sizeleft>0) + { + printf("Try to write %d\n",sizeleft); + ret=usb_bulk_write(phidgetDevice->handle, 0x01, (void *)(buffer+wrote),sizeleft, 5000); + + if (ret!=-1) + { + if (ret<0) + { + char temp[64]; + sprintf(temp,"Tried to write %d, but got error %d\n",size,ret); + DBG(temp); + return (_error(LPE_CONTROL_MSG_ERROR)); + } + + sizeleft-=ret; + wrote+=ret; + } + } + */ + + + /* + if (ret!=size) + { + char temp[64]; + sprintf(temp,"Tried to write %d but only wrote %d\n",size,ret); + DBG(temp); + return (_error(LPE_CONTROL_MSG_ERROR)); + } + */ return (_error(LPE_NONE)); *************** *** 1468,1476 **** } - /* enum ELPError phidget8Servo(struct phidget *phidgetDevice, int id, float percent, float maxvelocity, float acceleration) { char buffer[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; ! float *temp=&buffer; DBG("phidget8Servo"); --- 1568,1577 ---- } enum ELPError phidget8Servo(struct phidget *phidgetDevice, int id, float percent, float maxvelocity, float acceleration) { + /* + // Bad doesn't work, not sure where I got this from. char buffer[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; ! float *temp=(float *)buffer; DBG("phidget8Servo"); *************** *** 1486,1491 **** return (phidgetWrite(phidgetDevice, buffer, sizeof(buffer))); } - */ /** --- 1587,1647 ---- return (phidgetWrite(phidgetDevice, buffer, sizeof(buffer))); + */ + + /* Ok, couldn't figure out the protocol from everything I had been told, so i decided to + * figure it out on my own, put values in and see what happens + */ + + + int k; + int t; + char buffer[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + + buffer[0]=id; // Which servo to control + + buffer[1]=0; // These three didn't seem to do much in the protocol + buffer[2]=0; + buffer[3]=0; + + + buffer[4]=0; + buffer[5]=0; + buffer[6]=0; // The position goes here + buffer[7]=0; + buffer[8]=0; + buffer[9]=0; + buffer[10]=0; + buffer[11]=0; + buffer[12]=0; + buffer[13]=0; + buffer[14]=0; // Needs to be over 6 I think? or + buffer[15]=1; // Has to be 1 or greater + + // Write the position, this seems to work. + ((int *)(buffer+5))[0] = percent*16218; + + + //buffer[7]=buffer[5]; + //buffer[6]=buffer[4]; + //buffer[4]=0; + //buffer[5]=0; + + // This stuff didn't work either + // + //((short int *)(buffer+4))[0] = (int)(percent*16218); + //((int *)(buffer+4))[1] = rand()%16218; + //((int *)(buffer+4))[2] = rand()%16218; + + //((int *)(buffer+4))[0] = (int)((percent/10.0 /*+ 23.0*/) * 16218); + //((int *)(buffer+4))[1] = (int)((maxvelocity / 50.0) * 16218); + //((int *)(buffer+4))[2] = (int)((acceleration / 50.0) * 16218); + + //((int *)(buffer+4))[0]=16218/2; + //((int *)(buffer+4))[1]=16218/2; + //((int *)(buffer+4))[2]=16218/2; + + // Write to the phidget + return (phidgetWrite(phidgetDevice, buffer, sizeof(buffer))); } /** *************** *** 1533,1537 **** buffer[2] = 0; buffer[3] = 0; ! phidgetWrite(phidgetDevice,buffer,4); } --- 1689,1693 ---- buffer[2] = 0; buffer[3] = 0; ! return(phidgetWrite(phidgetDevice,buffer,4)); } *************** *** 1586,1589 **** --- 1742,1760 ---- /** + * Helper function to set the Pulse on and Pulse off length for the PhidgetPower controller + */ + enum ELPError phidgetPower( struct phidget *phidgetDevice, int index, int on, int off ) + { + char buffer[6]; + buffer[0] = (unsigned char)index ; + buffer[1] = (unsigned char)(on % 256); + buffer[2] = (unsigned char)(on / 256); + buffer[3] = (unsigned char)(off % 256); + buffer[4] = (unsigned char)(off / 256); + + return(phidgetWrite(phidgetDevice,buffer,6)); + } + + /** * Helper function to clear the Text LCD */ *************** *** 1607,1611 **** buffer[2] = 0x42; // 0: 0 1 0 0 0 0 1 0 <- Power Save, Oscillator Circuit ON buffer[7] = 3; ! phidgetWrite(phidgetDevice,buffer,8); } --- 1778,1782 ---- buffer[2] = 0x42; // 0: 0 1 0 0 0 0 1 0 <- Power Save, Oscillator Circuit ON buffer[7] = 3; ! return(phidgetWrite(phidgetDevice,buffer,8)); } *************** *** 1620,1624 **** buffer[1] = 0x40; // 0: 0 1 0 0 0 0 0 0 <- Power Save, Oscillator Circuit ON buffer[7] = 2; ! phidgetWrite(phidgetDevice,buffer,8); } --- 1791,1795 ---- buffer[1] = 0x40; // 0: 0 1 0 0 0 0 0 0 <- Power Save, Oscillator Circuit ON buffer[7] = 2; ! return(phidgetWrite(phidgetDevice,buffer,8)); } Index: phidget.h =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/libphidget/phidget.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** phidget.h 23 Dec 2002 04:38:40 -0000 1.21 --- phidget.h 23 Jun 2003 22:37:34 -0000 1.22 *************** *** 83,87 **** LP_INTERFACE_KIT_488 = 302, //!< 488 interface kit LP_ENCODER = 400, //!< Currently unsupported ! LP_POWER = 500, //!< Currently unsupported LP_RFID = 600, //!< Currently unsupported LP_LED = 700, //!< Currently unsupported --- 83,87 ---- LP_INTERFACE_KIT_488 = 302, //!< 488 interface kit LP_ENCODER = 400, //!< Currently unsupported ! LP_POWER = 500, //!< PhidgetPower LP_RFID = 600, //!< Currently unsupported LP_LED = 700, //!< Currently unsupported *************** *** 189,192 **** --- 189,202 ---- ); + /** + * Set the Pulse on and Pulse off length for the PhidgetPower controller + */ + enum ELPError phidgetPower( + struct phidget *device, //<! The phidget to write to + int index, //<! The index of the output to adjust + int on, //<! 0-65535, time on per pulse; in 128 us increments + int off //<! 0-65535, time off per pulse; in 128 us increments + ); + /** * Send an angle (0.0 to 1.0) to a single servo. The phidget servo controllers *************** *** 261,265 **** ); ! //enum ELPError phidget8Servo(struct phidget *phidgetDevice, int id, float percent1, float maxvelocity, float acceleration); /** --- 271,275 ---- ); ! enum ELPError phidget8Servo(struct phidget *phidgetDevice, int id, float percent1, float maxvelocity, float acceleration); /** |
From: Jack S. <js...@us...> - 2002-12-23 04:38:44
|
Update of /cvsroot/libphidget/libphidget/src/libphidget In directory sc8-pr-cvs1:/tmp/cvs-serv25634/libphidget Modified Files: phidget.c phidget.h Log Message: Lot's of changes with how servo controller classes work. Now added seperate classes for servo controllers (uni and quad). Index: phidget.c =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/libphidget/phidget.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** phidget.c 16 Dec 2002 22:23:31 -0000 1.26 --- phidget.c 23 Dec 2002 04:38:40 -0000 1.27 *************** *** 95,98 **** --- 95,104 ---- void *defaultData; + /** Size of extra data */ + int extraDataSize; + + /** Extra data used to store any configuration info for a phidget */ + void *extraData; + /** Virtual state of the device, this keeps the state of the device even when it is detached. */ enum *************** *** 561,565 **** --- 567,574 ---- temp->attached = 0; temp->openedState = WAS_CLOSED; + temp->defaultDataSize = 0; temp->defaultData = NULL; + temp->extraDataSize = 0; + temp->extraData = NULL; /** *************** *** 899,904 **** _clearDeviceTypes(); ! _registerDeviceType("QuadServo .1 Degree", 0x06C2, 0x0038, LP_SERVO_CONTROLLER); ! _registerDeviceType("UniServo .1 Degree", 0x06C2, 0x0039, LP_SERVO_CONTROLLER); _registerDeviceType("Interface Kit 4/8/8", 0x0925, 0x8201, LP_INTERFACE_KIT_488); _registerDeviceType("Interface Kit 4/8/8", 0x06C2, 0x0040, LP_INTERFACE_KIT_488); --- 908,913 ---- _clearDeviceTypes(); ! _registerDeviceType("QuadServo .1 Degree", 0x06C2, 0x0038, LP_QUAD_SERVO); ! _registerDeviceType("UniServo .1 Degree", 0x06C2, 0x0039, LP_UNI_SERVO); _registerDeviceType("Interface Kit 4/8/8", 0x0925, 0x8201, LP_INTERFACE_KIT_488); _registerDeviceType("Interface Kit 4/8/8", 0x06C2, 0x0040, LP_INTERFACE_KIT_488); *************** *** 907,911 **** _registerDeviceType("PhidgetTextLCD ECMA1010 Ver 1.0", 0x06C2, 0x0050,LP_TEXT_LCD); //_registerDeviceType("RFID VID/PID", 0x06C2, 0x0030, LP_OTHER); ! //_registerDeviceType("8-AdvancedServo", 0x06C2, 0x003B, LP_SERVO_CONTROLLER); //_registerDeviceType("Interface Kit 32-32-0", 0x06C2, 0x0042, LP_INTERFACE_KIT); //_registerDeviceType("Interface Kit 0-256-0", 0x06C2, 0x0043, LP_INTERFACE_KIT); --- 916,920 ---- _registerDeviceType("PhidgetTextLCD ECMA1010 Ver 1.0", 0x06C2, 0x0050,LP_TEXT_LCD); //_registerDeviceType("RFID VID/PID", 0x06C2, 0x0030, LP_OTHER); ! //_registerDeviceType("8-AdvancedServo", 0x06C2, 0x003B, LP_8WAY_SERVO); //_registerDeviceType("Interface Kit 32-32-0", 0x06C2, 0x0042, LP_INTERFACE_KIT); //_registerDeviceType("Interface Kit 0-256-0", 0x06C2, 0x0043, LP_INTERFACE_KIT); *************** *** 1128,1132 **** if (phidgetDevice->handle) { ! if (phidgetDevice->type->deviceClass == LP_SERVO_CONTROLLER) { if (phidgetDevice->defaultData == NULL) --- 1137,1144 ---- if (phidgetDevice->handle) { ! if ( ! phidgetDevice->type->deviceClass == LP_UNI_SERVO || ! phidgetDevice->type->deviceClass == LP_QUAD_SERVO ! ) { if (phidgetDevice->defaultData == NULL) *************** *** 1212,1234 **** enum ELPError phidgetSingleServo(struct phidget *phidgetDevice, float percent) { ! int pulse; ! char buffer[6] = { 0 }; ! DBG("phidgetSingleServo"); ! if (phidgetDevice == NULL) ! return (_error(LPE_INVALID_PHIDGET)); ! if (phidgetDevice->type == NULL) ! return (_error(LPE_WRONG_PHIDGET_CLASS_TYPE)); ! // Not a servo ! if (phidgetDevice->type->deviceClass != LP_SERVO_CONTROLLER) ! return (_error(LPE_WRONG_PHIDGET_CLASS_TYPE)); ! pulse = (int) (((percent) * 180) * 10.6f + 230); ! buffer[0] = pulse % 256; ! buffer[1] = (pulse / 256); ! return (phidgetWrite(phidgetDevice, buffer, sizeof(buffer))); } --- 1224,1287 ---- enum ELPError phidgetSingleServo(struct phidget *phidgetDevice, float percent) { ! int _min=230,_max=(int) (180 * 10.6f + 230)+_min; ! int pulse; ! char buffer[6] = { 0 }; ! DBG("phidgetSingleServo"); ! if (phidgetDevice == NULL) ! return (_error(LPE_INVALID_PHIDGET)); ! if (phidgetDevice->type == NULL) ! return (_error(LPE_WRONG_PHIDGET_CLASS_TYPE)); ! // Not a servo ! if (phidgetDevice->type->deviceClass != LP_UNI_SERVO) ! return (_error(LPE_WRONG_PHIDGET_CLASS_TYPE)); ! //pulse = (int) (((percent) * 180) * 10.6f + 230); ! if (phidgetDevice->extraData!=NULL) ! { ! int *temp=(int *)phidgetDevice->extraData; ! _min=temp[0]; ! _max=temp[1]; ! } ! //pulse = (int) (((percent) * 180) * 10.6f + 230); ! pulse=(percent*(_max-_min))+_min; ! ! buffer[0] = pulse % 256; ! buffer[1] = (pulse / 256); ! ! return (phidgetWrite(phidgetDevice, buffer, sizeof(buffer))); ! } ! ! /** ! * Helper function to set the minimum and maximum pulse values for a servo on a phidget ! */ ! enum ELPError phidgetSingleServoSetMinMaxPulse(struct phidget *phidgetDevice, int minimum, int maximum) ! { ! int buffer[2]; ! ! DBG("phidgetSingleServoSetMinMaxPulse"); ! ! if (phidgetDevice == NULL) ! return (_error(LPE_INVALID_PHIDGET)); ! if (phidgetDevice->type == NULL) ! return (_error(LPE_WRONG_PHIDGET_CLASS_TYPE)); ! ! // Not a servo ! if (phidgetDevice->type->deviceClass != LP_UNI_SERVO) ! return (_error(LPE_WRONG_PHIDGET_CLASS_TYPE)); ! ! // Free any defaults that have already been set ! if (phidgetDevice->extraData != NULL) ! free(phidgetDevice); ! ! buffer[0]=minimum; ! buffer[1]=maximum; ! ! phidgetDevice->extraDataSize = sizeof(buffer); ! phidgetDevice->extraData = malloc(phidgetDevice->extraDataSize); ! memcpy(phidgetDevice->extraData, buffer, phidgetDevice->extraDataSize); } *************** *** 1250,1254 **** // Not a servo ! if (phidgetDevice->type->deviceClass != LP_SERVO_CONTROLLER) return (_error(LPE_WRONG_PHIDGET_CLASS_TYPE)); --- 1303,1307 ---- // Not a servo ! if (phidgetDevice->type->deviceClass != LP_UNI_SERVO) return (_error(LPE_WRONG_PHIDGET_CLASS_TYPE)); *************** *** 1276,1279 **** --- 1329,1336 ---- int pulse1, pulse2, pulse3, pulse4; char buffer[6] = { 0 }; + int _min1=230,_max1=(int) (180 * 10.6f + 230)+_min1; + int _min2=230,_max2=(int) (180 * 10.6f + 230)+_min2; + int _min3=230,_max3=(int) (180 * 10.6f + 230)+_min3; + int _min4=230,_max4=(int) (180 * 10.6f + 230)+_min4; DBG("phidgetQuadServo"); *************** *** 1286,1297 **** // Not a servo ! if (phidgetDevice->type->deviceClass != LP_SERVO_CONTROLLER) return (_error(LPE_WRONG_PHIDGET_CLASS_TYPE)); ! pulse1 = (int) (((percent1) * 180) * 10.6f + 230); ! pulse2 = (int) (((percent2) * 180) * 10.6f + 230); ! pulse3 = (int) (((percent3) * 180) * 10.6f + 230); ! pulse4 = (int) (((percent4) * 180) * 10.6f + 230); buffer[0] = pulse1 % 256; --- 1343,1371 ---- // Not a servo ! if (phidgetDevice->type->deviceClass != LP_QUAD_SERVO) return (_error(LPE_WRONG_PHIDGET_CLASS_TYPE)); ! //pulse1 = (int) (((percent1) * 180) * 10.6f + 230); ! //pulse2 = (int) (((percent2) * 180) * 10.6f + 230); ! //pulse3 = (int) (((percent3) * 180) * 10.6f + 230); ! //pulse4 = (int) (((percent4) * 180) * 10.6f + 230); ! ! if (phidgetDevice->extraData!=NULL) ! { ! int *temp=(int *)phidgetDevice->extraData; ! _min1=temp[0]; ! _max1=temp[1]; ! _min2=temp[2]; ! _min2=temp[3]; ! _min3=temp[4]; ! _max3=temp[5]; ! _max4=temp[6]; ! _max4=temp[7]; ! } ! pulse1=(percent1*(_max1-_min1))+_min1; ! pulse2=(percent2*(_max2-_min2))+_min2; ! pulse3=(percent3*(_max3-_min3))+_min3; ! pulse4=(percent4*(_max4-_min4))+_min4; buffer[0] = pulse1 % 256; *************** *** 1324,1328 **** // Not a servo ! if (phidgetDevice->type->deviceClass != LP_SERVO_CONTROLLER) return (_error(LPE_WRONG_PHIDGET_CLASS_TYPE)); --- 1398,1402 ---- // Not a servo ! if (phidgetDevice->type->deviceClass != LP_QUAD_SERVO) return (_error(LPE_WRONG_PHIDGET_CLASS_TYPE)); *************** *** 1351,1354 **** --- 1425,1469 ---- return (_error(LPE_NONE)); + } + + /** + * Helper function to set the minimum and maximum pulse values for a quad servo on a phidget + */ + enum ELPError phidgetQuadServoSetMinMaxPulse(struct phidget *phidgetDevice, + int minimum0, int maximum0, + int minimum1, int maximum1, + int minimum2, int maximum2, + int minimum3, int maximum3 + ) + { + int buffer[8]; + + DBG("phidgetSingleServoSetMinMaxPulse"); + + if (phidgetDevice == NULL) + return (_error(LPE_INVALID_PHIDGET)); + if (phidgetDevice->type == NULL) + return (_error(LPE_WRONG_PHIDGET_CLASS_TYPE)); + + // Not a servo + if (phidgetDevice->type->deviceClass != LP_QUAD_SERVO) + return (_error(LPE_WRONG_PHIDGET_CLASS_TYPE)); + + // Free any defaults that have already been set + if (phidgetDevice->extraData != NULL) + free(phidgetDevice); + + buffer[0]=minimum0; + buffer[1]=maximum0; + buffer[2]=minimum1; + buffer[3]=maximum1; + buffer[4]=minimum2; + buffer[5]=maximum2; + buffer[6]=minimum3; + buffer[7]=maximum3; + + phidgetDevice->extraDataSize = sizeof(buffer); + phidgetDevice->extraData = malloc(phidgetDevice->extraDataSize); + memcpy(phidgetDevice->extraData, buffer, phidgetDevice->extraDataSize); } Index: phidget.h =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/libphidget/phidget.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** phidget.h 21 Dec 2002 02:55:07 -0000 1.20 --- phidget.h 23 Dec 2002 04:38:40 -0000 1.21 *************** *** 71,107 **** enum EDeviceClass { ! LP_ALL = 1, /**< All devices match this */ // Actual phidget types ! LP_PHIDGET = 100, /**< Generic phidget, not used in this library */ ! ! LP_SERVO_CONTROLLER = 200, /**< Identifies all servo controller phidgets */ ! ! LP_INTERFACE_KIT = 300, /**< Identifies all interface kit phidgets, support being added now */ ! LP_INTERFACE_KIT_880 = 301, /**< 880 interface kit */ ! LP_INTERFACE_KIT_488 = 302, /**< 488 interface kit */ ! ! LP_ENCODER = 400, /**< Currently unsupported */ ! ! LP_POWER = 500, /**< Currently unsupported */ ! ! LP_RFID = 600, /**< Currently unsupported */ ! ! LP_LED = 700, /**< Currently unsupported */ ! ! LP_TEXT_LCD = 800, /**< Text LCD */ // Phidget subdevices, a phidget subdevice is something a phidget controls ! LP_SUB_DEVICE = 101, /**< A SubDevice of a phidget, not used in this library */ ! LP_SERVO = 201, /**< Sero sub-device, any servo that a servo controller controls */ ! LP_DIGITAL_IN = 394, /**< Digital in sub-device, any digital input that an interface kit controls */ ! LP_DIGITAL_OUT = 395, /**< Digltal out sub-device, any digital output that an interface kit controls */ ! LP_ANALOG_IN = 396, /**< Analog in sub-device, any analog input that an interface kit controls */ ! LP_ANALOG_OUT = 397, /**< Analog out sub-device, any analog input that an interface kit controls, currently phidget currently handles analog output */ ! LP_IN = 398, /**< Input sub-device, Any input that an interface kit controls */ ! LP_OUT = 399, /**< Output sub-device, Any output that an interface kit controls */ ! ! LP_OTHER = 0, /**< Identifies all unknown phidgets, this shouldn't exist */ ! LP_INVALID = -2, /**< Invalid device class, any negative device class is an error. */ }; --- 71,102 ---- enum EDeviceClass { ! LP_ALL = 1, //!< All devices match this // Actual phidget types ! LP_PHIDGET = 100, //!< Generic phidget, not used in this library ! LP_SERVO_CONTROLLER = 200, //!< Identifies all servo controller phidgets ! LP_UNI_SERVO = 201, //!< Single servo controller ! LP_QUAD_SERVO = 202, //!< Quad servo controller ! LP_8WAY_SERVO = 203, //!< 8 Way servo controller ! LP_INTERFACE_KIT = 300, //!< Identifies all interface kit phidgets, support being added now ! LP_INTERFACE_KIT_880 = 301, //!< 880 interface kit ! LP_INTERFACE_KIT_488 = 302, //!< 488 interface kit ! LP_ENCODER = 400, //!< Currently unsupported ! LP_POWER = 500, //!< Currently unsupported ! LP_RFID = 600, //!< Currently unsupported ! LP_LED = 700, //!< Currently unsupported ! LP_TEXT_LCD = 800, //!< Text LCD // Phidget subdevices, a phidget subdevice is something a phidget controls ! LP_SUB_DEVICE = 101, //!< A SubDevice of a phidget, not used in this library ! LP_SERVO = 201, //!< Sero sub-device, any servo that a servo controller controls ! LP_DIGITAL_IN = 394, //!< Digital in sub-device, any digital input that an interface kit controls ! LP_DIGITAL_OUT = 395, //!< Digltal out sub-device, any digital output that an interface kit controls ! LP_ANALOG_IN = 396, //!< Analog in sub-device, any analog input that an interface kit controls ! LP_ANALOG_OUT = 397, //!< Analog out sub-device, any analog input that an interface kit controls, currently phidget currently handles analog output ! LP_IN = 398, //!< Input sub-device, Any input that an interface kit controls ! LP_OUT = 399, //!< Output sub-device, Any output that an interface kit controls ! LP_OTHER = 0, //!< Identifies all unknown phidgets, this shouldn't exist ! LP_INVALID = -2, //!< Invalid device class, any negative device class is an error. }; *************** *** 215,218 **** --- 210,222 ---- ); + /** + * Helper function to set the minimum and maximum pulse values for a servo on a phidget + */ + enum ELPError phidgetSingleServoSetMinMaxPulse( + struct phidget *phidgetDevice, //<! The phidget whoses pulse values we want to set + int minimum, //<! The minimum pulse value (when percent=0) + int maximum //<! The maximum pulse value (when percent=1) + ); + /** * Send an angle (0.0 to 1.0) to four servos. The phidget servo controllers *************** *** 240,243 **** --- 244,262 ---- float percent3, //!< Percentage to move servo 3 float percent4 //!< Percentage to move servo 4 + ); + + /** + * Helper function to set the minimum and maximum pulse values for a quad servo on a phidget + */ + enum ELPError phidgetQuadServoSetMinMaxPulse( + struct phidget *phidgetDevice, //<! The phidget whoses pulse values we want to set + int minimum0, //<! The minium pulse value for servo 0 (when percent=0) + int maximum0, //<! The minium pulse value for servo 0 (when percent=1) + int minimum1, //<! The minium pulse value for servo 1 (when percent=0) + int maximum1, //<! The minium pulse value for servo 1 (when percent=1) + int minimum2, //<! The minium pulse value for servo 2 (when percent=0) + int maximum2, //<! The minium pulse value for servo 2 (when percent=1) + int minimum3, //<! The minium pulse value for servo 3 (when percent=0) + int maximum3 //<! The minium pulse value for servo 3 (when percent=1) ); |
From: Jack S. <js...@us...> - 2002-12-23 04:38:44
|
Update of /cvsroot/libphidget/libphidget/src/examples In directory sc8-pr-cvs1:/tmp/cvs-serv25634/examples Modified Files: phidget_c.c Log Message: Lot's of changes with how servo controller classes work. Now added seperate classes for servo controllers (uni and quad). Index: phidget_c.c =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/examples/phidget_c.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** phidget_c.c 17 Dec 2002 22:12:11 -0000 1.18 --- phidget_c.c 23 Dec 2002 04:38:39 -0000 1.19 *************** *** 21,25 **** int t, count; struct phidget **phidgets; ! int SERVO=0; int IK488=0; int IKDIGITALWRITE=0; --- 21,27 ---- int t, count; struct phidget **phidgets; ! int SERVO1=0; ! int SERVO4=0; ! int SERVO8=0; int IK488=0; int IKDIGITALWRITE=0; *************** *** 81,87 **** if (argn==2) { ! if (strcmp(argv[1],"SERVO1")==0) SERVO=1; ! if (strcmp(argv[1],"SERVO4")==0) SERVO=1; ! if (strcmp(argv[1],"SERVO8")==0) SERVO=1; if (strcmp(argv[1],"IK488")==0) IK488=1; if (strcmp(argv[1],"IK880")==0) IK880=1; --- 83,89 ---- if (argn==2) { ! if (strcmp(argv[1],"SERVO1")==0) SERVO1=1; ! if (strcmp(argv[1],"SERVO4")==0) SERVO4=1; ! if (strcmp(argv[1],"SERVO8")==0) SERVO8=1; if (strcmp(argv[1],"IK488")==0) IK488=1; if (strcmp(argv[1],"IK880")==0) IK880=1; *************** *** 131,136 **** } ! if (SERVO) ! if (phidgetTypeDeviceClass (phidgetType (dev)) == LP_SERVO_CONTROLLER) { for (k = 0; k < 1; k += .1) --- 133,140 ---- } ! if ( ! (SERVO1 && phidgetTypeDeviceClass (phidgetType (dev)) == LP_UNI_SERVO) || ! (SERVO4 && phidgetTypeDeviceClass (phidgetType (dev)) == LP_QUAD_SERVO) ! ) { for (k = 0; k < 1; k += .1) *************** *** 139,148 **** printf ("%f\n",k); ! // Move a single servo (will move servo 0 of a 1 or 4 servo controller) ! //if (phidget8Servo (dev, k,0,.1,.1)<0) ! if (phidgetSingleServo (dev, k)<0) { ! printf("error - %s\n",phidgetErrorString(phidgetLastError())); ! return(5); } --- 143,164 ---- printf ("%f\n",k); ! // Move a single servo (will move ! ! if (SERVO1) { ! if (phidgetSingleServo (dev, k)<0) ! { ! printf("error - %s\n",phidgetErrorString(phidgetLastError())); ! return(5); ! } ! } ! ! if (SERVO4) ! { ! if (phidgetQuadServo (dev, k,k,k,k)<0) ! { ! printf("error - %s\n",phidgetErrorString(phidgetLastError())); ! return(5); ! } } |
From: Jack S. <js...@us...> - 2002-12-23 04:38:44
|
Update of /cvsroot/libphidget/libphidget/src/phidget++ In directory sc8-pr-cvs1:/tmp/cvs-serv25634/phidget++ Modified Files: CPhidgetManager.cc CPhidgetManager.h CServoController.cc Log Message: Lot's of changes with how servo controller classes work. Now added seperate classes for servo controllers (uni and quad). Index: CPhidgetManager.cc =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CPhidgetManager.cc,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** CPhidgetManager.cc 21 Dec 2002 03:31:39 -0000 1.15 --- CPhidgetManager.cc 23 Dec 2002 04:38:40 -0000 1.16 *************** *** 83,86 **** --- 83,87 ---- devices.insert(temp_uid); + // If the device class is a phidget or ALL then we have found it. if (tp==LP_PHIDGET || tp==LP_ALL) *************** *** 88,96 **** // handle some special cases ! if (tp==LP_INTERFACE_KIT && dc==LP_INTERFACE_KIT_880) ! devices.insert(temp_uid); ! ! if (tp==LP_INTERFACE_KIT && dc==LP_INTERFACE_KIT_488) ! devices.insert(temp_uid); } --- 89,96 ---- // handle some special cases ! if (tp==LP_INTERFACE_KIT && dc==LP_INTERFACE_KIT_880) devices.insert(temp_uid); ! if (tp==LP_INTERFACE_KIT && dc==LP_INTERFACE_KIT_488) devices.insert(temp_uid); ! if (tp==LP_SERVO_CONTROLLER && dc==LP_UNI_SERVO) devices.insert(temp_uid); ! if (tp==LP_SERVO_CONTROLLER && dc==LP_QUAD_SERVO) devices.insert(temp_uid); } *************** *** 222,226 **** switch (deviceClass) { ! case LP_SERVO_CONTROLLER: { CServoController *sc = new CServoController (uid); --- 222,228 ---- switch (deviceClass) { ! case LP_UNI_SERVO: ! case LP_QUAD_SERVO: ! //case LP_8WAY_SERVO: { CServoController *sc = new CServoController (uid); Index: CPhidgetManager.h =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CPhidgetManager.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CPhidgetManager.h 21 Dec 2002 03:31:39 -0000 1.8 --- CPhidgetManager.h 23 Dec 2002 04:38:40 -0000 1.9 *************** *** 20,33 **** * </p> * ! * Okay , the problem is I want to be able to query for the devices currently attached * which is fine for just phidgets. But if we haven't created a phidget to manage this ! * device we don't know anything about this device. * ! * So, for example, we can attach a phidget servo controller with 4 servos to a computer. * Intial query for phidgets reveals 1, whle a query for servos reveals 0. * Now if we ask for or create or own servo controller object, then when we query for ! * number of servos we get 4. This is just the way it will be. * * */ --- 20,52 ---- * </p> * ! * <p>Okay , the problem is I want to be able to query for the devices currently attached * which is fine for just phidgets. But if we haven't created a phidget to manage this ! * device we don't know anything about this device.</p> * ! * <p>So, for example, we can attach a phidget servo controller with 4 servos to a computer. * Intial query for phidgets reveals 1, whle a query for servos reveals 0. * Now if we ask for or create or own servo controller object, then when we query for ! * number of servos we get 4. This is just the way it will be.</p> * + * <p>These are the main phidget classes available:</p> * + * <ul> + * <li> CServoController </li> + * <ul> + * <li> CServo </li> + * </ul> + * <li> CInterfaceKit </li> + * <ul> + * <li> CDigitalIn </li> + * <li> CDigitalOut </li> + * <li> CAnalogIn </li> + * </ul> + * <li> CTextLCD </li> + * </ul> + * + * <p>Hopefully I can document some of the examples soon that will better explain how + * this library works. After the documentation the code in the example directory are + * a good starting point. I tried to keep them simple. You can also contact me and I'd + * be happy to help you out.</p> */ Index: CServoController.cc =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CServoController.cc,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CServoController.cc 21 Dec 2002 03:58:11 -0000 1.9 --- CServoController.cc 23 Dec 2002 04:38:40 -0000 1.10 *************** *** 23,26 **** --- 23,47 ---- // Make sure it was constructed properly + switch (classType()) + { + case LP_UNI_SERVO: + { + setServoCount(1); + break; + } + case LP_QUAD_SERVO: + { + setServoCount(4); + break; + } + //case LP_8WAY_SERVO: + //{ + //setServoCount(8); + //break; + //} + default: + throw runtime_error("Can't initialize a CServoController with a phidget that is not a servo controller"); + } + /* if (classType() != LP_SERVO_CONTROLLER) throw runtime_error("Can't initialize a CServoController with a phidget that is not a servo controller"); *************** *** 51,54 **** --- 72,77 ---- } } + */ + METHOD_UNGUARD; } *************** *** 139,143 **** { METHOD_GUARD; ! if (_servoCount) { float p1 = 0, p2 = 0, p3 = 0, p4 = 0; --- 162,176 ---- { METHOD_GUARD; ! if (_servoCount==1) ! { ! float p1 = 0; ! ! if (_servoCount >= 1 && _servos[0].second != NULL) ! p1 = _servos[0].second->position(); ! ! error(phidgetSingleServo(device(), p1)); ! } ! else ! if (_servoCount==4) { float p1 = 0, p2 = 0, p3 = 0, p4 = 0; |
Update of /cvsroot/libphidget/libphidget/src/phidget++ In directory sc8-pr-cvs1:/tmp/cvs-serv2636 Modified Files: CAnalogIn.h CDigitalIn.h CDigitalOut.h CInterfaceKit.h CServo.h CSubDevice.h CTextLCD.cc CTextLCD.h Log Message: More documentation Index: CAnalogIn.h =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CAnalogIn.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** CAnalogIn.h 21 Dec 2002 04:17:01 -0000 1.12 --- CAnalogIn.h 21 Dec 2002 04:41:24 -0000 1.13 *************** *** 40,44 **** * InterfaceKit calls this to set the value of the input */ ! void setValue(float value) ; public: --- 40,46 ---- * InterfaceKit calls this to set the value of the input */ ! void setValue( ! float value //!< The value to set this input ! ); public: *************** *** 46,50 **** * Should be used to construct user derivations of this class */ ! CAnalogIn (const CUID &uid); /** --- 48,54 ---- * Should be used to construct user derivations of this class */ ! CAnalogIn ( ! const CUID &uid //!< The UID of the analog input ! ); /** Index: CDigitalIn.h =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CDigitalIn.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** CDigitalIn.h 21 Dec 2002 04:17:01 -0000 1.14 --- CDigitalIn.h 21 Dec 2002 04:41:24 -0000 1.15 *************** *** 40,44 **** * InterfaceKit calls this to set the value of the input */ ! void setValue(bool value); public: --- 40,46 ---- * InterfaceKit calls this to set the value of the input */ ! void setValue( ! bool value //!< The value to set this input to ! ); public: *************** *** 46,50 **** * Should be used to construct user derivations of this class */ ! CDigitalIn ( const CUID &uid); /** --- 48,54 ---- * Should be used to construct user derivations of this class */ ! CDigitalIn ( ! const CUID &uid //!< The UID of the digital input ! ); /** Index: CDigitalOut.h =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CDigitalOut.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** CDigitalOut.h 21 Dec 2002 04:17:01 -0000 1.11 --- CDigitalOut.h 21 Dec 2002 04:41:24 -0000 1.12 *************** *** 34,38 **** * This constructor is used when an InterfaceKit generates the device */ ! CDigitalOut (CInterfaceKit *interfacekit, int id); public: --- 34,41 ---- * This constructor is used when an InterfaceKit generates the device */ ! CDigitalOut ( ! CInterfaceKit *interfacekit, //!< The interface this output is part of ! int id //!< The id of this device ! ); public: *************** *** 47,51 **** * Sends a value to the interface kit */ ! void value(bool val); /** --- 50,56 ---- * Sends a value to the interface kit */ ! void value( ! bool val //!< The value we want to send ! ); /** Index: CInterfaceKit.h =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CInterfaceKit.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** CInterfaceKit.h 18 Dec 2002 02:51:16 -0000 1.11 --- CInterfaceKit.h 21 Dec 2002 04:41:24 -0000 1.12 *************** *** 105,109 **** * Constructor */ ! CInterfaceKit(const CUID &uid); /** --- 105,111 ---- * Constructor */ ! CInterfaceKit( ! const CUID &uid //!< The UID of the interface kit ! ); /** *************** *** 121,145 **** * this find command */ ! CUniqueDevice *find(const CUID &uid, bool create); /** * Returns a specific analog input, can create it if it hasn't been created already */ ! CAnalogIn *analogIn(const int id, bool create=true); /** * Returns a specific digital input, can create it if it hasn't been created already */ ! CDigitalIn *digitalIn(const int id, bool create=true); /** * Returns a specific digital output, can create it if it hasn't been created already */ ! CDigitalOut *digitalOut(const int id, bool create=true); /** ! * Query for any subdevices that match this criteria */ ! void query(const EDeviceClass tp, set < CUID >&devices); }; --- 123,162 ---- * this find command */ ! CUniqueDevice *find( ! const CUID &uid, //!< The UID of the device we are looking for ! bool create //!< Do we need to try to create it if we can ! ); /** * Returns a specific analog input, can create it if it hasn't been created already */ ! CAnalogIn *analogIn( ! const int id, //!< The analog input number ! bool create=true //!< Do we need to create this object if we can't find a valid one. ! ); /** * Returns a specific digital input, can create it if it hasn't been created already */ ! CDigitalIn *digitalIn( ! const int id, //!< The digital input number ! bool create=true //!< Do we need to create this object if we can't find a valid one. ! ); /** * Returns a specific digital output, can create it if it hasn't been created already */ ! CDigitalOut *digitalOut( ! const int id, //!< The digital output number ! bool create=true //!< Do we need to create this object if we can't find a valid one. ! ); /** ! * Query for a device that matches the libphidget device class passed in. */ ! virtual void query( ! const EDeviceClass tp, //!< The device class we are looking for ! set < CUID >&devices //!< This will be filled with UID's of phidgets (or sub-objects) that match the device class ! ); }; Index: CServo.h =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CServo.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CServo.h 21 Dec 2002 04:17:01 -0000 1.9 --- CServo.h 21 Dec 2002 04:41:24 -0000 1.10 *************** *** 49,54 **** * Set's the current position of this servo */ ! void position(float percent //!< Percentage to turn this servo ! ); /** --- 49,55 ---- * Set's the current position of this servo */ ! void position( ! float percent //!< Percentage to turn this servo ! ); /** Index: CSubDevice.h =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CSubDevice.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CSubDevice.h 18 Dec 2002 02:51:17 -0000 1.3 --- CSubDevice.h 21 Dec 2002 04:41:24 -0000 1.4 *************** *** 24,28 **** * subdevice should call this function. */ ! void ordinal(int ordinal) { _ordinal=ordinal; --- 24,30 ---- * subdevice should call this function. */ ! void ordinal( ! int ordinal //!< Value to set the ordinal ! ) { _ordinal=ordinal; *************** *** 30,40 **** /** ! * Construct a sub device */ ! CSubDevice::CSubDevice (CPhidget *parent, int id) : CUniqueDevice (parent, id) { } public: --- 32,55 ---- /** ! * Construct a sub device. */ ! CSubDevice::CSubDevice ( ! CPhidget *parent, //!< The parent that manages this device ! int id //!< The id of this device ! ) : CUniqueDevice (parent, id) { } + /** + * Construct a sub device. No managing device is required, it will be found or created as necessary by CUniqueDevice. + */ + CSubDevice::CSubDevice ( + const CUID &uid //!< The UID of the device to create + ) : + CUniqueDevice (uid) + { + } + public: *************** *** 58,73 **** } - /** - * Construct a sub device - */ - CSubDevice::CSubDevice (const CUID &uid) : - CUniqueDevice (uid) - { - } /** ! * Queries for any unique id devices that may exists, or are known how to create. ! */ ! virtual void query(const EDeviceClass tp, set < CUID >&devices) { CUniqueDevice::query(tp,devices); --- 73,84 ---- } /** ! * Query for a device that matches the libphidget device class passed in. ! */ ! virtual void query( ! const EDeviceClass tp, //!< The device class we are looking for ! set < CUID >&devices //!< This will be filled with UID's of phidgets (or sub-objects) that match the device class ! ) { CUniqueDevice::query(tp,devices); Index: CTextLCD.cc =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CTextLCD.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CTextLCD.cc 17 Dec 2002 23:39:16 -0000 1.3 --- CTextLCD.cc 21 Dec 2002 04:41:24 -0000 1.4 *************** *** 59,60 **** --- 59,68 ---- phidgetTextLCDOff(device()); } + + void CTextLCD::query( const EDeviceClass tp, set < CUID >&devices ) + { + if (tp == LP_TEXT_LCD) + devices.insert(UID()); + else + CPhidget::query(tp,devices); + } Index: CTextLCD.h =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CTextLCD.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CTextLCD.h 17 Dec 2002 23:39:16 -0000 1.4 --- CTextLCD.h 21 Dec 2002 04:41:24 -0000 1.5 *************** *** 29,33 **** * Construct a Text LCD */ ! CTextLCD (const CUID &uid, bool autooff=false); /** --- 29,36 ---- * Construct a Text LCD */ ! CTextLCD ( ! const CUID &uid, //!< The UID of the text lcd to create ! bool autooff=false //!< If this is true then the LCD will automatically turn off when this object deconstructs ! ); /** *************** *** 39,43 **** * Send text to this display */ ! void sendText(string text, int row, int col); /** --- 42,50 ---- * Send text to this display */ ! void sendText( ! string text, //!< String to send to lcd ! int row, //!< Row to place string ! int col //!< Column to place string ! ); /** *************** *** 56,66 **** void off(); ! virtual void query(const EDeviceClass tp, set < CUID >&devices) ! { ! if (tp == LP_TEXT_LCD) ! devices.insert(UID()); ! else ! CPhidget::query(tp,devices); ! } }; --- 63,73 ---- void off(); ! /** ! * Query for a device that matches the libphidget device class passed in. ! */ ! virtual void query( ! const EDeviceClass tp, //!< The device class we are looking for ! set < CUID >&devices //!< This will be filled with UID's of phidgets (or sub-objects) that match the device class ! ); }; |
Update of /cvsroot/libphidget/libphidget/src/phidget++ In directory sc8-pr-cvs1:/tmp/cvs-serv28710 Modified Files: CAnalogIn.h CDigitalIn.h CDigitalOut.h CServo.h CUniqueDevice.cc CUniqueDevice.h TSingleton.h Log Message: More documentation Index: CAnalogIn.h =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CAnalogIn.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** CAnalogIn.h 17 Dec 2002 23:39:16 -0000 1.11 --- CAnalogIn.h 21 Dec 2002 04:17:01 -0000 1.12 *************** *** 79,82 **** --- 79,87 ---- */ CInterfaceKit &interfaceKit() ; + + /** + * No events + */ + void processEvents() { } }; Index: CDigitalIn.h =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CDigitalIn.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** CDigitalIn.h 18 Dec 2002 02:51:16 -0000 1.13 --- CDigitalIn.h 21 Dec 2002 04:17:01 -0000 1.14 *************** *** 79,82 **** --- 79,87 ---- */ CInterfaceKit &interfaceKit() ; + + /** + * No events + */ + void processEvents() { } }; Index: CDigitalOut.h =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CDigitalOut.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** CDigitalOut.h 17 Dec 2002 23:39:16 -0000 1.10 --- CDigitalOut.h 21 Dec 2002 04:17:01 -0000 1.11 *************** *** 58,61 **** --- 58,66 ---- */ CInterfaceKit &interfaceKit() ; + + /** + * No events + */ + void processEvents() { } }; Index: CServo.h =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CServo.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CServo.h 17 Dec 2002 23:39:16 -0000 1.8 --- CServo.h 21 Dec 2002 04:17:01 -0000 1.9 *************** *** 86,89 **** --- 86,96 ---- */ CServoController &servoController(); + + /** + * No events to process + */ + void processEvents() + { + } }; Index: CUniqueDevice.cc =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CUniqueDevice.cc,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CUniqueDevice.cc 15 Dec 2002 23:41:55 -0000 1.6 --- CUniqueDevice.cc 21 Dec 2002 04:17:01 -0000 1.7 *************** *** 16,17 **** --- 16,23 ---- METHOD_UNGUARD; } + + void CUniqueDevice::query( const EDeviceClass tp, set < CUID >&devices) + { + if (tp==LP_ALL) + devices.insert(UID()); + } Index: CUniqueDevice.h =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CUniqueDevice.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CUniqueDevice.h 18 Dec 2002 02:51:17 -0000 1.9 --- CUniqueDevice.h 21 Dec 2002 04:17:01 -0000 1.10 *************** *** 30,33 **** --- 30,37 ---- protected: + + /** + * Used to set the parent of this device. + */ void parent(CUniqueDevice *parent) { *************** *** 41,45 **** * which is it's parent */ ! CUniqueDevice (CUniqueDevice *parent, const int id) : _uid(parent, id), _parent(parent) --- 45,52 ---- * which is it's parent */ ! CUniqueDevice ( ! CUniqueDevice *parent, //!< The parent of this device ! const int id //!< This devices ID ! ) : _uid(parent, id), _parent(parent) *************** *** 51,55 **** * Construct a unique device that is a Phidget from a UID */ ! CUniqueDevice (const CUID &uid) : _uid(uid), _parent(NULL) --- 58,64 ---- * Construct a unique device that is a Phidget from a UID */ ! CUniqueDevice ( ! const CUID &uid //!< unique ID of the device, this type of constructor is for devices without parents ! ) : _uid(uid), _parent(NULL) *************** *** 85,89 **** * don't manage any sub devices they can just rely on this method */ ! virtual CUniqueDevice *find(const CUID &uid, bool create = true) { if (uid == _uid) --- 94,101 ---- * don't manage any sub devices they can just rely on this method */ ! virtual CUniqueDevice *find( ! const CUID &uid, //!< Unique device we are looking for ! bool create = true //!< By default if anything can create this UID phidget it will try to. ! ) { if (uid == _uid) *************** *** 94,108 **** /** ! * Queries for any unique id devices that may exists, or are known how to create. ! */ ! virtual void query(const EDeviceClass tp, set < CUID >&devices) ! { ! if (tp==LP_ALL) ! devices.insert(UID()); ! } ! virtual void processEvents() ! { ! } }; --- 106,120 ---- /** ! * Query for a device that matches the libphidget device class passed in. ! */ ! virtual void query( ! const EDeviceClass tp, //!< The device class we are looking for ! set < CUID >&devices //!< This will be filled with UID's of phidgets (or sub-objects) that match the device class ! ); ! /** ! * Must implement this to handle any events you want to look for ! */ ! virtual void processEvents()=0; }; Index: TSingleton.h =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/phidget++/TSingleton.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TSingleton.h 17 Dec 2002 22:56:17 -0000 1.5 --- TSingleton.h 21 Dec 2002 04:17:01 -0000 1.6 *************** *** 88,91 **** --- 88,95 ---- public: + + /** + * Empty destructor + */ virtual ~ TSingleton () { *************** *** 135,144 **** --- 139,161 ---- }; + /** + * This was created so that I can guarantee a TSingleton object is destroyed on + * exit. Basic will the stack is rolled back this is destoryed and it releases + * the singleton. + */ template <class T >class AutoDestroy { public: + + /** + * Default destructor + */ AutoDestroy() { } + + /** + * This does the magic of destroying the singleton on the destruction of this object + */ ~AutoDestroy() { |
From: Jack S. <js...@us...> - 2002-12-21 04:02:28
|
Update of /cvsroot/libphidget/libphidget/src/phidget++ In directory sc8-pr-cvs1:/tmp/cvs-serv24835 Modified Files: CUID.cc CUID.h Log Message: Documentation Index: CUID.cc =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CUID.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CUID.cc 16 Sep 2002 06:43:33 -0000 1.5 --- CUID.cc 21 Dec 2002 04:02:23 -0000 1.6 *************** *** 49,53 **** { METHOD_GUARD; ! (*this) = id; METHOD_UNGUARD; } --- 49,53 ---- { METHOD_GUARD; ! (*this) = id; METHOD_UNGUARD; } *************** *** 56,63 **** { METHOD_GUARD; ! _serial = id._serial; ! _id = id._id; ! return (*this); METHOD_UNGUARD; } --- 56,63 ---- { METHOD_GUARD; ! _serial = id._serial; ! _id = id._id; ! return (*this); METHOD_UNGUARD; } *************** *** 66,74 **** { METHOD_GUARD; ! if (_serial != id._serial) ! return (false); ! if (_id != id._id) ! return (false); ! return (true); METHOD_UNGUARD; } --- 66,77 ---- { METHOD_GUARD; ! ! if (_serial != id._serial) ! return (false); ! ! if (_id != id._id) ! return (false); ! ! return (true); METHOD_UNGUARD; } *************** *** 83,87 **** { METHOD_GUARD; ! return (_serial); METHOD_UNGUARD; } --- 86,90 ---- { METHOD_GUARD; ! return (_serial); METHOD_UNGUARD; } *************** *** 90,94 **** { METHOD_GUARD; ! return (_id); METHOD_UNGUARD; } --- 93,97 ---- { METHOD_GUARD; ! return (_id); METHOD_UNGUARD; } *************** *** 98,106 **** { METHOD_GUARD; ! if (_serial < id._serial) ! return (true); ! if (_serial > id._serial) ! return (false); ! return (_id < id._id); METHOD_UNGUARD; } --- 101,113 ---- { METHOD_GUARD; ! ! if (_serial < id._serial) ! return (true); ! ! if (_serial > id._serial) ! return (false); ! ! return (_id < id._id); ! METHOD_UNGUARD; } *************** *** 109,117 **** { METHOD_GUARD; ! if (_serial < id._serial) ! return (false); ! if (_serial > id._serial) ! return (true); ! return (_id > id._id); METHOD_UNGUARD; } --- 116,128 ---- { METHOD_GUARD; ! ! if (_serial < id._serial) ! return (false); ! ! if (_serial > id._serial) ! return (true); ! ! return (_id > id._id); ! METHOD_UNGUARD; } *************** *** 120,131 **** { METHOD_GUARD; ! char temp[16]; ! if (_id == -1) ! sprintf(temp, "%d", _serial); ! else ! sprintf(temp, "%d:%d", _serial, _id); - return (string(temp)); METHOD_UNGUARD; } --- 131,143 ---- { METHOD_GUARD; ! char temp[16]; ! if (_id == -1) ! sprintf(temp, "%d", _serial); ! else ! sprintf(temp, "%d:%d", _serial, _id); ! ! return (string(temp)); METHOD_UNGUARD; } Index: CUID.h =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CUID.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CUID.h 17 Dec 2002 23:39:16 -0000 1.6 --- CUID.h 21 Dec 2002 04:02:23 -0000 1.7 *************** *** 32,35 **** --- 32,39 ---- public: + + /** + * Default constructor, this won't be a valid UID. + */ CUID (); *************** *** 37,41 **** * Initialize a CUID for a phidget device */ ! CUID (const int serial //!< The serial number of the phidget ); --- 41,46 ---- * Initialize a CUID for a phidget device */ ! CUID ( ! const int serial //!< The serial number of the phidget ); *************** *** 43,47 **** * Initialize a CUID for a phidget device */ ! CUID (const int serial, //!< The serial number of the phidget const int id); --- 48,53 ---- * Initialize a CUID for a phidget device */ ! CUID ( ! const int serial, //!< The serial number of the phidget const int id); *************** *** 50,55 **** * Intialize a CUID for a device attached to a phidget */ ! CUID (const CUniqueDevice *device, //!< The phidget that controls this device ! const int id //!< The id for the device attached to this phidget ); --- 56,62 ---- * Intialize a CUID for a device attached to a phidget */ ! CUID ( ! const CUniqueDevice *device, //!< The phidget that controls this device ! const int id //!< The id for the device attached to this phidget ); *************** *** 59,62 **** --- 66,72 ---- CUID (const CUID &id); + /** + * Standard destructor + */ virtual ~CUID(); |
From: Jack S. <js...@us...> - 2002-12-21 03:58:14
|
Update of /cvsroot/libphidget/libphidget/src/phidget++ In directory sc8-pr-cvs1:/tmp/cvs-serv23200 Modified Files: CServoController.cc CServoController.h Log Message: Documentation Index: CServoController.cc =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CServoController.cc,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CServoController.cc 17 Dec 2002 21:20:24 -0000 1.8 --- CServoController.cc 21 Dec 2002 03:58:11 -0000 1.9 *************** *** 21,24 **** --- 21,25 ---- { METHOD_GUARD; + // Make sure it was constructed properly if (classType() != LP_SERVO_CONTROLLER) *************** *** 135,210 **** } - /* - void CServoController::setServoCount(int num) - { - if (_servos.size()!=0) - throw runtime_error("Can only call this function one."); - - for (int t=0;t<num;t++) - _servos.push_back(new CServo(this,t)); - } - - CServoController::CServoController(CServoController *orig) : - CPhidget(orig) - { - for (int t=0;t<orig->_servos.size();t++) - _servos.push_back(new CServo(this,t,orig->_servos[t])); - } - - - CServoController::CServoController(phidget *device) : - CPhidget(device) - { - if (classType()!=SERVO_CONTROLLER) - throw runtime_error("Can't initialize a CServoController with a phidget that is not a servo controller"); - - switch(productID()) - { - case 0x0038: - { - setServoCount(4); - break; - } - case 0x0039: - { - setServoCount(1); - break; - } - case 0x003B: - { - setServoCount(8); - break; - } - default: - { - char temp[128]; - sprintf(temp,"Unknown type of servo controller Vendor ID:0x0%x Product ID:0x0%x\n",vendorID(),productID()); - throw runtime_error(temp); - } - } - } - - CServoController::~CServoController() - { - // If we replace a servo then we need to reset it's servo info - if (getReplacement()!=NULL) - { - CServoController *rep=dynamic_cast<CServoController *>(getReplacement()); - - for (int t=0;t<_servos.size();t++) - { - CServo &a=*(rep->_servos[t]); - CServo &b=*(_servos[t]); - - a=b; - } - } - - - for (int t=0;t<_servos.size();t++) - delete _servos[t]; - } - */ - void CServoController::update() { --- 136,139 ---- *************** *** 231,248 **** } ! /* ! const vector <CServo *> &CServoController::servos() const { ! return(_servos); ! } ! CUniqueDevice *CServoController::find(const CUID &uid) ! { ! for (int t=0;t<_servos.size();t++) ! { ! if (_servos[t]->UID()==uid) ! return(_servos[t]); ! } ! return(NULL); } - */ --- 160,169 ---- } ! void CServoController::query(const EDeviceClass tp, set < CUID >&devices) { ! CPhidget::query(tp, devices); ! if (tp == LP_SERVO || tp == LP_ALL || tp == LP_SUB_DEVICE ) ! for (int t = 0; t < _servoCount; t++) ! devices.insert(CUID (UID().serial(), t)); } Index: CServoController.h =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CServoController.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CServoController.h 18 Dec 2002 02:51:17 -0000 1.8 --- CServoController.h 21 Dec 2002 03:58:11 -0000 1.9 *************** *** 27,31 **** int _servoCount; ! pair < bool, CServo *>*_servos; void setServoCount(int num); --- 27,31 ---- int _servoCount; ! pair <bool, CServo *> *_servos; void setServoCount(int num); *************** *** 34,45 **** public: - CServoController (const CUID &uid); /** ! * Constructor to be used when a user derives from this phidget, the user must ! * get a CServoController from the PhidgetManager he wishes to replace and then ! * pass it to this constructor, in the constructor of his derived type. ! */ ! //CServoController(CServoController *orig); /** --- 34,45 ---- public: /** ! * Construct a servo controller and get the device from the phidget manager ! * using the supplied CUID ! */ ! CServoController ( ! const CUID &uid //!< CUID of the servo controller you want to construct ! ); /** *************** *** 57,66 **** * Search for any devices or sub-devices that match this uid */ ! CUniqueDevice *find(const CUID &uid, bool create); /** * returns a previously created servo */ ! CServo *servo(int id, bool create = true); /** --- 57,72 ---- * Search for any devices or sub-devices that match this uid */ ! CUniqueDevice *find( ! const CUID &uid, //!< UID of the object you want to find ! bool create //!< if this is true then it will try to create if it can find something that can create it. ! ); /** * returns a previously created servo */ ! CServo *servo( ! int id, //!< The ID of the servo we want ! bool create = true //!< By default it will create a servo you request if it can't find an already created one. ! ); /** *************** *** 73,86 **** /** ! * Query for devices or sub-devices that match a certain class */ ! virtual void query(const EDeviceClass tp, set < CUID >&devices) ! { ! CPhidget::query(tp, devices); ! ! if (tp == LP_SERVO || tp == LP_ALL || tp == LP_SUB_DEVICE ) ! for (int t = 0; t < _servoCount; t++) ! devices.insert(CUID (UID().serial(), t)); ! } }; --- 79,88 ---- /** ! * Query for a device that matches the libphidget device class passed in. */ ! virtual void query( ! const EDeviceClass tp, //!< The device class we are looking for ! set < CUID >&devices //!< This will be filled with UID's of phidgets (or sub-objects) that match the device class ! ); }; |