[Libphidget-cvs-commits] CVS: libphidget/src/examples phidget_c.c,1.14,1.15
Status: Alpha
Brought to you by:
jstrohm
|
From: Jack S. <js...@us...> - 2002-12-14 23:38:16
|
Update of /cvsroot/libphidget/libphidget/src/examples
In directory sc8-pr-cvs1:/tmp/cvs-serv16834/examples
Modified Files:
phidget_c.c
Log Message:
Added digital output on the 488, should work on the 880 also.
Index: phidget_c.c
===================================================================
RCS file: /cvsroot/libphidget/libphidget/src/examples/phidget_c.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** phidget_c.c 14 Dec 2002 18:23:06 -0000 1.14
--- phidget_c.c 14 Dec 2002 23:38:13 -0000 1.15
***************
*** 63,66 ****
--- 63,67 ----
printf(" IK488 - test 488 interface kit\n");
printf(" IK880 - test 880 interface kit\n");
+ printf(" IKDIGITALWRITE - write data to the 488 or 880 interface kit\n");
printf(" TEXTLCD - test text lcd\n");
***************
*** 75,78 ****
--- 76,80 ----
int SERVO=0;
int IK488=0;
+ int IKDIGITALWRITE=0;
int IK880=0;
int TEXTLCD=0;
***************
*** 84,87 ****
--- 86,90 ----
if (strcmp(argv[1],"IK488")==0) IK488=1;
if (strcmp(argv[1],"IK880")==0) IK880=1;
+ if (strcmp(argv[1],"IKDIGITALWRITE")==0) IKDIGITALWRITE=1;
if (strcmp(argv[1],"TEXTLCD")==0) TEXTLCD=1;
***************
*** 151,155 ****
}
}
!
if (IK488)
if (phidgetTypeDeviceClass (phidgetType (dev)) == LP_INTERFACE_KIT_488)
--- 154,158 ----
}
}
!
if (IK488)
if (phidgetTypeDeviceClass (phidgetType (dev)) == LP_INTERFACE_KIT_488)
***************
*** 183,186 ****
--- 186,212 ----
}
+ }
+
+ if (IKDIGITALWRITE)
+ if (
+ (phidgetTypeDeviceClass (phidgetType (dev)) == LP_INTERFACE_KIT_488) ||
+ (phidgetTypeDeviceClass (phidgetType (dev)) == LP_INTERFACE_KIT_880)
+ )
+ {
+ int t,k;
+
+ printf("Start:\n");
+ for (t=0;t<8;t++)
+ {
+ printf("Turning output %d on\n",t+1);
+ phidgetInterfaceKit488Write(dev,t,1);
+ sleep(1);
+ }
+ for (t=0;t<8;t++)
+ {
+ printf("Turning output %d off\n",t+1);
+ phidgetInterfaceKit488Write(dev,t,0);
+ }
+ printf("Finished\n");
}
|