View Single Post
  #1   Spotlight this post!  
Unread 08-03-2007, 16:17
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Code to Read the Binary Inputs on Analog Buttons

Does anyone have example code on how to read the binary digits from the OIs analog inputs? According to Mike only the first 4 binary digits are used to determine buttons being pressed.

For Example:

1000 0000 = Button 1
0100 0000 = Button 2
0010 0000 = BUtton 3
0001 0000 = Button 4

The trouble is the last four digits are random and fluctuate greatly
depending on what mood the chicklet is in so sometimes

1000 0000 = Button 1
or
1000 0001 = Button 1
or
1000 0010 = Button 1

The problem is we really don't want to make 4 cases for every button.
So we just want to ignore them.
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni

Last edited by Kingofl337 : 08-03-2007 at 16:26.
Reply With Quote