Thread: More Buttons
View Single Post
  #9   Spotlight this post!  
Unread 08-02-2008, 00:04
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: More Buttons

Quote:
Originally Posted by kylelanman View Post
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.