[Libphidget-cvs-commits] CVS: libphidget/src/examples phidget_c.c,1.9,1.10
Status: Alpha
Brought to you by:
jstrohm
From: Jack S. <js...@us...> - 2002-12-13 22:05:19
|
Update of /cvsroot/libphidget/libphidget/src/examples In directory sc8-pr-cvs1:/tmp/cvs-serv7153/examples Modified Files: phidget_c.c Log Message: Fixed some bugs and added a test for 088 phidget Index: phidget_c.c =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/examples/phidget_c.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** phidget_c.c 13 Dec 2002 21:16:22 -0000 1.9 --- phidget_c.c 13 Dec 2002 22:05:15 -0000 1.10 *************** *** 93,96 **** --- 93,97 ---- } else + if (phidgetTypeDeviceClass (phidgetType (dev)) == LP_INTERFACE_KIT_884) { int t,k; *************** *** 100,104 **** float analog[8]; int digital[8]; ! if (phidgetInterfaceKit488Read(dev,analog,digital)<0) { printf("error - %s\n",phidgetErrorString(phidgetLastError())); --- 101,105 ---- float analog[8]; int digital[8]; ! if (phidgetInterfaceKit884Read(dev,analog,digital)<0) { printf("error - %s\n",phidgetErrorString(phidgetLastError())); *************** *** 123,127 **** } } ! phidgetEvents (); // Close the phidget --- 124,163 ---- } } ! else ! if (phidgetTypeDeviceClass (phidgetType (dev)) == LP_INTERFACE_KIT_088) ! { ! int t,k; ! ! while(1) ! { ! float analog[8]; ! int digital[8]; ! if (phidgetInterfaceKit088Read(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]); ! ! ! } ! } // Close the phidget |