View Single Post
  #2   Spotlight this post!  
Unread 22-10-2014, 02:47
asid61's Avatar
asid61 asid61 is offline
Registered User
AKA: Anand Rajamani
FRC #0115 (MVRT)
Team Role: Mechanical
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Cupertino, CA
Posts: 2,215
asid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond repute
Re: potentiometer code

What language? You use the center pin of the potentiometer to find voltage when you connect the other two terminals to power and ground (one to power, the other to ground). Then you map that voltage between the maximum and minimum voltage you can get from the potentiometer (turn it all the way one way and all the way the other way to find that) and that's how you get your angle relative to the minimum and maximum.