View Single Post
  #1   Spotlight this post!  
Unread 30-01-2002, 16:18
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
Try this:

Declare nice_motor as a variable byte
Then state that:
nice_motor = 127 + (127*button1) - (127*button2)

And of course, serout nice_motor to the desired PWM pin

What will happen:

If button 1 is pressed, the motor will go full forward, if button 0 is pressed, it'll go full reverse, and if you press them both (who would do that? ), nothing happens.
__________________
Manoel Flores da Cunha
Mentor
Brazilian Machine
Team # 383