View Single Post
  #4   Spotlight this post!  
Unread 30-09-2003, 22:51
EricS-Team180's Avatar
EricS-Team180 EricS-Team180 is offline
SPAM, the lunchmeat of superheroes!
AKA: Eric Schreffler
FRC #0180 (SPAM)
Team Role: Engineer
 
Join Date: Apr 2002
Rookie Year: 2001
Location: Stuart, Florida
Posts: 561
EricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond repute
You could key off of the trigger to indicate the addition or subtraction of a fixed value (1,5,10) to a pwm output.

Initialize to a pwm output of neutral (127). Then, you'll need a direction bit (fwd/rev) so you know whether to add or subtract, and a trigger latch bit so you don't loop through the code a bunch of times, changing the pwm, before you let go of the trigger. You'll also want to min and max (1, 254) so you don't roll over.
__________________

Don't PANIC!
S. P. A. M.