CMU Button Box and getting registers and IsInverted

Hello,
I am wanting to be able to get the current status of the button registers of a CMU button box. I've fiddled with the GetEvent code from the CMUbox.m file and have not been able to make it so I can fetch the current status of the registers. Currently the best I can do it make it tell me when there has been a change, but I need to be able to look at the registers as well to do some other things. So is there a way to just fetch/poll the state of each button?

Second question set is, Is IsInverted working on CMU button boxes? What is the bit order of the vector? If I were to set a bit to 1 in the vector, that means that when the bit is '0', then a button press registers?

Thanks.


Nick
--- In psychtoolbox@yahoogroups.com, "Nick" <metcalfn@...> wrote:
>
> Hello,
> I am wanting to be able to get the current status of the button registers of a CMU button box. I've fiddled with the GetEvent code from the CMUbox.m file and have not been able to make it so I can fetch the current status of the registers. Currently the best I can do it make it tell me when there has been a change, but I need to be able to look at the registers as well to do some other things. So is there a way to just fetch/poll the state of each button?
>

Not afaik. But if you keep track of the data from the most recent non-isempty() 'GetEvent' call, you'll know at any point in time what the button state is.

Technically, and this is a hardware design that can only be adequately called utterly brain-dead, the box streams its current status 1920 times per second iirc and our driver filters and discards all bytes which don't indicate a button state change in a sweet attempt to cope with this non-sense, so you could disable the 'ReadFilterFlags' setup line in CMUBox.m to get permanent updates - or be overwhelmed with all this useless junk data.

> Second question set is, Is IsInverted working on CMU button boxes? What is the bit order of the vector? If I were to set a bit to 1 in the vector, that means that when the bit is '0', then a button press registers?
>

Nope, it only affects the "bitwhacker" box iirc, a little detail that is not mentioned in our help.

-mario

> Thanks.
>
>
> Nick
>
Yeah, I went with the storing of the previous state and just spitting it back out till it changed via press or release event. Might go back and see just what kind of a mess I get by turning off the filter.

I realized after hunting through the CMUBox.m file that the IsInverted only applies to bitwhacker :)

Thanks a bunch though.

Nick
--- In psychtoolbox@yahoogroups.com, "Mario" <mario.kleiner@...> wrote:
>
> --- In psychtoolbox@yahoogroups.com, "Nick" <metcalfn@> wrote:
> >
> > Hello,
> > I am wanting to be able to get the current status of the button registers of a CMU button box. I've fiddled with the GetEvent code from the CMUbox.m file and have not been able to make it so I can fetch the current status of the registers. Currently the best I can do it make it tell me when there has been a change, but I need to be able to look at the registers as well to do some other things. So is there a way to just fetch/poll the state of each button?
> >
>
> Not afaik. But if you keep track of the data from the most recent non-isempty() 'GetEvent' call, you'll know at any point in time what the button state is.
>
> Technically, and this is a hardware design that can only be adequately called utterly brain-dead, the box streams its current status 1920 times per second iirc and our driver filters and discards all bytes which don't indicate a button state change in a sweet attempt to cope with this non-sense, so you could disable the 'ReadFilterFlags' setup line in CMUBox.m to get permanent updates - or be overwhelmed with all this useless junk data.
>
> > Second question set is, Is IsInverted working on CMU button boxes? What is the bit order of the vector? If I were to set a bit to 1 in the vector, that means that when the bit is '0', then a button press registers?
> >
>
> Nope, it only affects the "bitwhacker" box iirc, a little detail that is not mentioned in our help.
>
> -mario
>
> > Thanks.
> >
> >
> > Nick
> >
>