Thread: pwms
View Single Post
  #3   Spotlight this post!  
Unread 10-01-2007, 08:59
SuperBK's Avatar
SuperBK SuperBK is offline
Registered User
AKA: BrianK
FRC #1225 (Amperage Robotics)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Henersonville, NC
Posts: 358
SuperBK is just really niceSuperBK is just really niceSuperBK is just really niceSuperBK is just really nice
Re: pwms

I think what your are asking is how to turn on a motor. Just setting the variable pwm01 will turn on (or off) the motor connected to the first pwm output. The reason all you need to do is set it is because that variable is returned to the master controller and it "writes" it to the register that turns on the motor.

In the default code its just set to the value from the joystick:
pwm01 = p1_y;

Note: to turn a motor off, set it to 127. Values less than 127 are reverse, values greater than 127 are forward. Its range is 0-255.

You can see all the variable you get for input and that you can set for output in the header file ifi_aliases.h

Brian