Page 1 of 1

Using more than two input bits for decision making

Posted: Wed Aug 30, 2006 1:39 am
by icabjeff
I need to know how I go about using all the individual input bits during decision making. I'm trying to see if I can use flowcode with e-blocks to create a handicapped switch adapted joystick and I need to use all 8 individual bits on one input port. I'm unable to get beyond using two individual bits at a time for input.

Jeff

Posted: Wed Aug 30, 2006 3:01 am
by Chet
try reading the entire port and make a decision based on the returned value.

Posted: Wed Aug 30, 2006 9:18 am
by Ian
Masks can be used to select certain bits from the port as well if you need to check only some of the inputs.

Also, if the joystick you mentioned uses analogue pots you can try reading in the analogue input from those pots and using the value from that in a similar manner to using the whole port value as Chet suggested.

Most PC joysticks have the pots all ready in place so you can just tap into their outputs.

You can use SampleADC to sample the anlogue input and readHigh or ReadLow to get the values. For a basic system the high 0-255 value may be enough on it's own.