Go to Post We might just dip the entire bot in a Locktite bath before bagging. - Kevin Ray [more]
Home
Go Back   Chief Delphi > Technical > Electrical
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 07-02-2007, 20:25
Nicole_Ypes Nicole_Ypes is offline
Nicole Ypes
FRC #1547 (Waldo)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Waldo!
Posts: 7
Nicole_Ypes is an unknown quantity at this point
Send a message via MSN to Nicole_Ypes
Exclamation Potentiometer Problems

My team is having trouble with our potentiometer. We have all three leads conected and we have tested them for voltage and resistence, and both turned up to be fine. We have checks everything over, but we just can't get the values to print to screen. We are using easyc pro but I typed out the code:

#include "Main.h"

void main( void )
{
unsigned int PotValues;

while (1)
{
PotValues = GetAnalogInput(1);
PrintToScreen("%u\n ,(int)PotValues);
}
}


Can anyone help me here? This just does not seem to be working, We compared this programto those of last years but still has not turned anything up, we also tried using MPLab but still nothing. If anyone can help us out, we would really appreciate it!
  #2   Spotlight this post!  
Unread 07-02-2007, 21:10
Jake M Jake M is offline
void* Jake;
FRC #1178 (DURT)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Missouri
Posts: 118
Jake M has a spectacular aura aboutJake M has a spectacular aura about
Re: Potentiometer Problems

Well, firstly, are you sure you have the wires connected correctly. There should be a diagram of some sort on the pot itself, that looks like this.

(1)__________________(3)
(2)_________|

If the diagram isn't on there, the offset pin on the pot will be number 2. Pin 1 goes to white, 2 to red, and 3 to black, on a PWM cable from an Analog Input.

Other than that, I don't use easyc and I couldn't tell you if that's the problem.
__________________
Code:
void function(void)
 {
  function();
 }
  #3   Spotlight this post!  
Unread 07-02-2007, 23:33
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Potentiometer Problems

Quote:
Originally Posted by Jake M View Post
Well, firstly, are you sure you have the wires connected correctly. There should be a diagram of some sort on the pot itself, that looks like this.

(1)__________________(3)
(2)_________|

If the diagram isn't on there, the offset pin on the pot will be number 2. Pin 1 goes to white, 2 to red, and 3 to black, on a PWM cable from an Analog Input.

Other than that, I don't use easyc and I couldn't tell you if that's the problem.
Don't you mean 1 to red, 2 to white, and 3 to black, or 1 to black, 2 to white, 3 to red? Or did I confuse something. I think if you do this, you will release some magic smoke. Please correct me if I'm wrong, I have our potentiometer connected this way and I'm about to connect it tomorrow. Please Please reply.
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364
  #4   Spotlight this post!  
Unread 07-02-2007, 23:46
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,113
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: Potentiometer Problems

Your description is confusing. Are you actually having problems with a potentiometer, or is your problem right now just with printing the value being read? It seems to me that your question actually belongs in the Programming forum where someone who knows EasyC might be able to help.
  #5   Spotlight this post!  
Unread 08-02-2007, 08:02
Joohoo's Avatar
Joohoo Joohoo is offline
Registered User
FRC #0340 (G.R.R.)
Team Role: Mentor
 
Join Date: Jun 2005
Rookie Year: 2005
Location: Rochester
Posts: 241
Joohoo is just really niceJoohoo is just really niceJoohoo is just really niceJoohoo is just really niceJoohoo is just really nice
Send a message via AIM to Joohoo Send a message via Yahoo to Joohoo
Re: Potentiometer Problems

one thing that I can see that might be problem is you are locking yourself in an infinite while loop which might not be allow the program to print anything.

thats just what i see but, I have not worked with easy c.
  #6   Spotlight this post!  
Unread 08-02-2007, 09:39
Imajie Imajie is offline
Registered User
AKA: James Letendre
FRC #0195 (Cyber Knights)
Team Role: Electrical
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Southington
Posts: 114
Imajie has much to be proud ofImajie has much to be proud ofImajie has much to be proud ofImajie has much to be proud ofImajie has much to be proud ofImajie has much to be proud ofImajie has much to be proud ofImajie has much to be proud of
Send a message via AIM to Imajie
Re: Potentiometer Problems

Quote:
Originally Posted by Joohoo View Post
one thing that I can see that might be problem is you are locking yourself in an infinite while loop which might not be allow the program to print anything.

thats just what i see but, I have not worked with easy c.
With EasyC you don't need to worry about your loop speed like in MPLab, the while(1) loop is fine.

Isn't the potentiometer built in to EasyC, there should be a block under Inputs(I think) that says potentiometer that you can use that may help, although the way you are doing it should work fine.
__________________
2007 UTC Champions Thanks 1124 and 558
2007 UTC GM Industrial Design Award

2006 Newton Divisional Winners
2006 Championship finalists
(Thanks 25 and 968 for picking us!)
2006 National Innovation in Control
  #7   Spotlight this post!  
Unread 08-02-2007, 11:07
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 7,011
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: Potentiometer Problems

Quote:
Originally Posted by RyanN View Post
Don't you mean 1 to red, 2 to white, and 3 to black, or 1 to black, 2 to white, 3 to red? Or did I confuse something. I think if you do this, you will release some magic smoke. Please correct me if I'm wrong, I have our potentiometer connected this way and I'm about to connect it tomorrow. Please Please reply.
You ae correct: One "end" of the pot goes to black, the other "end" goes to red - this puts a 5 volt potential across the entire pot. You then connect the Wiper of the pot to the white, so the RC can read the voltage at the wiper contact (which varies from 0 to 5 volts). Using the diagram, black goes to 1 or 3, red goes to 3 or 1, and WHITE goes to TWO.

Don
__________________

I am N2IRZ - What's your callsign?
  #8   Spotlight this post!  
Unread 08-02-2007, 18:59
Jake M Jake M is offline
void* Jake;
FRC #1178 (DURT)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Missouri
Posts: 118
Jake M has a spectacular aura aboutJake M has a spectacular aura about
Re: Potentiometer Problems

Quote:
Originally Posted by RyanN View Post
Don't you mean 1 to red, 2 to white, and 3 to black, or 1 to black, 2 to white, 3 to red? Or did I confuse something. I think if you do this, you will release some magic smoke. Please correct me if I'm wrong, I have our potentiometer connected this way and I'm about to connect it tomorrow. Please Please reply.
Why do I always screw things up when I'm trying to help someone? Yes, your wiring is right. 1 to red, 2 to white, 3 to black. There won't be any smoke if you do it incorrectly, though.
__________________
Code:
void function(void)
 {
  function();
 }
Closed Thread


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
Potentiometer PID DustinB_3 Programming 28 15-02-2008 23:18
Potentiometer fezkazi Electrical 3 24-01-2007 13:29
Linear Potentiometer FRC1710 Motors 4 15-01-2007 19:20
Potentiometer help Unholy Programming 4 07-02-2006 17:48
Potentiometer Joshua May Technical Discussion 8 22-05-2004 19:51


All times are GMT -5. The time now is 06:57.

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