View Single Post
  #3   Spotlight this post!  
Unread 02-04-2013, 14:22
4733 4733 is offline
Registered User
FRC #4733
 
Join Date: Feb 2013
Location: calgary
Posts: 4
4733 is an unknown quantity at this point
Re: activate second-function motor with joystick

Quote:
Originally Posted by Arhowk View Post
Joystick j = new Joystick(1)

if(j.getRawButton(1)) //a on the xbox
{
pwm.set(1);
} else {
pwm.set(0);
}

you shouldn't use PWM, you should use what they physically are... it helps the system send the data in the correct format.

also, your robot doesn't have only one motor controller setup to your chassis there has to be atleast two or it won't turn. Ask your electrical team for the correct ports on the PWM, and dont spam 0's at the end of the constructor as that will error out
sorry for the late reply.

thanks for the advice, whats the code which you just posted and where would i paste it for it to work?

what we are trying to do is activate a motor at the push of a button by any means nessisary... i have no idea how to go about doing that.

Last edited by 4733 : 02-04-2013 at 14:25.
Reply With Quote