Go to Post "We used to shut the robot up in a box and send it away from home. Now we just suffocate it." - GaryVoshol [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Spotlight this post!  
Unread 10-01-2007, 19:56
Bongle's Avatar
Bongle Bongle is offline
Registered User
FRC #2702 (REBotics)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Waterloo
Posts: 1,069
Bongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond repute
Send a message via MSN to Bongle
Re: Potentiometer with ADC

It's pretty simple. Wire the potentiometer to a PWM cable (I forget how to do this since I didn't do it), and plug it into one of the appropriate RC inputs. I'm fairly sure that the white cable of the PWM cable is the signal line, while the red and black ones are positive and ground. Once it is set up, it should simply be the potentiometer with the PWM cable hanging off it. There is no need for additional wires or power.

Once you've done that, you can access whatever values it is reading with the function Get_Analog_Value(int whichInput).

For example, our potentiometer in the 2006 robot, we did:
Code:
curPotentReading = Get_Analog_Value(rc_ana_in03)
If I remember correctly, the returned value will be between 0 and 1024, since it is a 10-bit ADC.
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Motor with a built in Potentiometer..? Kaushal.K Motors 5 09-01-2007 08:31
With gyro need to access ADC for poteniometer mrozek Programming 0 21-02-2005 13:39
error with adc.h incognito_NICK Programming 2 05-02-2005 23:27
Potentiometer with BS2 sanddrag Programming 7 13-05-2004 19:21
ADC problems with C library and new code Larry Barello Programming 1 09-01-2004 22:31


All times are GMT -5. The time now is 20:42.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi