View Single Post
  #4   Spotlight this post!  
Unread 15-02-2005, 23:16
Manoel's Avatar
Manoel Manoel is offline
Registered User
FRC #0383 (Brazilian Machine)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 2000
Location: Porto Alegre, RS, Brazil
Posts: 608
Manoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond repute
Send a message via ICQ to Manoel Send a message via MSN to Manoel
Re: Programming motors with joystick buttons

Or, alternatively:

Code:
pwmxx = (127 + (127*p1_sw_top) - (127*p1_sw_trig));
,

Replace xx with the pwm output you'll be using for the motor. In this case, pressing p1_sw_top will make the motor go full forward, p1_sw_trig will make it full reverse, and pressing both will do nothing.

__________________
Manoel Flores da Cunha
Mentor
Brazilian Machine
Team # 383