View Single Post
  #18   Spotlight this post!  
Unread 21-08-2012, 23:04
Chris Hibner's Avatar Unsung FIRST Hero
Chris Hibner Chris Hibner is offline
Eschewing Obfuscation Since 1990
AKA: Lars Kamen's Roadie
FRC #0051 (Wings of Fire)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1997
Location: Canton, MI
Posts: 1,488
Chris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond repute
Re: Programming Puzzle

While my above post solves your math issue, you may have a bigger problem.

A continuous pot has a gap in which the wiper will not contact the resister band (right where it will flip from 5V to 0V). When that happens, the A/D pin will be at a floating voltage. You may get weird voltage readings in that band depending on how the A/D pin is "wired". Is there a pull-up or pull-down resistor on your board? If not, you should definitely add one so when the wiper loses contact, you have a defined voltage that is either 0V or 5V (not somewhere in between).
__________________
-
An ounce of perception is worth a pound of obscure.
Reply With Quote