View Single Post
  #8   Spotlight this post!  
Unread 10-02-2004, 09:06
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,562
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Mapping Buttons to PWMs

If you want to skip the if statement, you can use the following code

pwm03 = 127 + 63 * p1_sw_trig;

If you want your motor to be able to go backwards also, you can use 2 switches with the following code.

pwm03 = 127 + (63 * p1_sw_trig) - (63 * p1_sw_top);