Re: [Libphidget-devel] First stab at the 888 ik
Status: Alpha
Brought to you by:
jstrohm
|
From: Jack S. <js...@ja...> - 2003-07-04 06:33:18
|
On Thu, 2003-07-03 at 18:34, Tom Brown wrote:
> >
> > 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));
> }
>
>
Yes, that will work temporarily, but a better solution (moving that buffer into struct phidget will work better.
This implementation will only support a single 888.
--
Jack Strohm <js...@ja...>
|