Re: [Libphidget-devel] First stab at the 888 ik
Status: Alpha
Brought to you by:
jstrohm
|
From: Tom B. <tb...@ba...> - 2003-07-03 23:35:08
|
>
> I'll go implement a static char register ...
>
> -Tom
This seems to have the desired behaviour, I also added an 888 specific
check so as not to change the behaviour for the other phidgets...
-Tom
static unsigned char digitaloutputs = 0;
enum ELPError phidgetInterfaceKitWrite(struct phidget *phidgetDevice, int index,
{
char buffer[4];
if (phidgetDevice->type->deviceClass == LP_INTERFACE_KIT_888) {
if (value) {
digitaloutputs |= 1 << index;
} else {
digitaloutputs &= ~(1 << index);
}
buffer[0] = digitaloutputs;
} else {
buffer[0] = index+(value << 3);
}
buffer[1] = 0;
buffer[2] = 0;
buffer[3] = 0;
return(phidgetWrite(phidgetDevice,buffer,4));
}
|