View Single Post
  #2   Spotlight this post!  
Unread 11-02-2007, 23:02
mluckham's Avatar
mluckham mluckham is offline
Registered User
FRC #0758 (Sky Robotics)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2006
Location: Ontario, Canada
Posts: 116
mluckham will become famous soon enoughmluckham will become famous soon enough
Re: Limit Switch for PCM

Create your own variable to hold the value of the limit switch (connected to a Digital Input, of course).

Then you can do something like:

switchstate = DigitalInput(10); // read DI 10 limit switch
if (switchstate == 1)
pwm = 127;
else
pwm = something else;

PWMOutput(2, pwm); // output pwm value to PWM2


You are correct, the EasyC functions provided for PWM output do not include support for limit switches.