Quote:
Originally Posted by kylelanman
ust out of curiosity, is there an easy way to assign four buttons in place of an analog axis and have them accessable via four digital values in the top four bits of the analog channel like the USB-CHICKLET does?
|
Yes, there is. With the proper choice of five resistors in series between the +5 pin (1) and the analog input, and switches connected across four of them, you should be able to read the switch values directly from the analog value's bits.
In theory, the resistor values should be 1/2, 1/4, 1/8, 1/16, and 1/32 of 100k. In practice, some tweaking of values might be necessary. The switches go across the large four resistors. The small fifth one serves to offset the final value so small variations in resistance do not cause the high bits to change.