View Single Post
  #2   Spotlight this post!  
Unread 23-01-2009, 16:50
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Programming Joystick Buttons to toggle a motor on and off

Joystick stick3(3);//obviously
Jaguar jag1(3);//PWM port 3
bool btn3state=false;


if (stick3.GetRawButton(3))
{
if (btn3state)
{
jag3.Set(0.5);
btn3state=false;
}
else
{
jag3.Set(0.0);
btn3state=true;
}
}
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote