Go to Post Your GPA in High School and College is a reflection of your cooperation with educational processes, nothing more. It is NOT a measurement of how much you know or how much you can learn. - Mike Martus [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
  #19   Spotlight this post!  
Unread 21-01-2007, 02:41
NextPerception NextPerception is offline
Sleep-Deprived
AKA: Matt
FRC #0437 (Richardson Robotics)
Team Role: Mentor
 
Join Date: Sep 2004
Rookie Year: 2005
Location: Richardson, TX
Posts: 69
NextPerception has a spectacular aura aboutNextPerception has a spectacular aura aboutNextPerception has a spectacular aura about
Send a message via AIM to NextPerception
Re: Potentiometer PID

instead of

Code:
      if ( Button1 == 1 )
      {
            Target = 200 ;
      }
      else if ( Button2 == 1 )
      {
            Target = 400 ;
      }
      else if ( Button3 == 1 )
      {
            Target = 600 ;
      }
i would do this

Code:
      if ( (Button1 * Button2) + (Button2 * Button3) + (Button3 * Button1) + ( Button1 + Button2 + Button3 ) == 1 )   //prevents crazy values if more than one button is pressed and keeps the same value if no button is pressed
      {
            Target = (Button1 * 200) + (Button2 * 400) + (Button3 * 600)
      }
this just makes more sense to me and I just post it here for any like minded people out there. I think it takes a little less cpu time too.
__________________
What is this S - L - E - E - P you speak of?
Battlebots - My Robotics Website


Last edited by NextPerception : 21-01-2007 at 02:55.
 


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 help Unholy Programming 4 07-02-2006 17:48
Potentiometer Help! thoughtful Programming 4 18-02-2005 08:21
coding a potentiometer incognito_NICK Programming 5 14-02-2005 15:56
Potentiometer Joshua May Technical Discussion 8 22-05-2004 19:51
Potentiometer Theory Ulibrium Technical Discussion 6 25-01-2002 21:16


All times are GMT -5. The time now is 13:47.

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