View Single Post
  #2   Spotlight this post!  
Unread 01-30-2002, 03:44 PM
Unsung FIRST Hero
Matt Leese Matt Leese is offline
Been-In-FIRST-Too-Long
FRC #1438 (The Aztechs)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1998
Location: Long Beach, CA
Posts: 937
Matt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond repute
Send a message via AIM to Matt Leese
Assume you're using PWM7.

if button_pressed then toggleOn
PWM7 = 127
goto endToggle
toggleOn:
PWM7 = 254
endToggle

Make sure that you actually pass the PWM value through to the SerOut command (look at the sample for what to send). Also, make sure to limit the value to 254 and not 255. 255 is not a valid output value. The above is mostly in psuedocode but you should be able to figure the rest out.

Matt