View Single Post
  #4   Spotlight this post!  
Unread 12-02-2007, 15:06
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Limit Switch for PCM

Try this
Code:
if ( GetDigitalInput ( 1 ) && Input > 127 )
      {
            Input = 127 ;
      }
      else if ( GetDigitalInput ( 2 ) && Input < 127 )
      {
            Input = 127 ;
      }
If you are using an OI to PWM Block

Then delete it and add this.

Code:
Input = GetOIAInput ( 1 , 1 ) ;
      if ( GetDigitalInput ( 1 ) && Input > 127 )
      {
            Input = 127 ;
      }
      else if ( GetDigitalInput ( 2 ) && Input < 127 )
      {
            Input = 127 ;
      }
      SetPWM ( 1 , Input ) ;
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni