Thread: If a. Run motor
View Single Post
  #4   Spotlight this post!  
Unread 27-01-2017, 13:51
WilliamFRC4065's Avatar
WilliamFRC4065 WilliamFRC4065 is offline
Registered User
FRC #4065 (The Nerds of Prey)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2016
Location: Florida
Posts: 7
WilliamFRC4065 is an unknown quantity at this point
Re: If a. Run motor

Quote:
Originally Posted by WilliamFRC4065 View Post
Coming from a person who has scoured screen steps for the exact same thing...
(These are just examples)
Code:
//First declare the joystick somewhere as a pointer
frc::Joystick* controller;
Then,
Code:
//Make a bool and assign it to the controllers button in Telop
bool a;
Code:
//Pretend 1 is A for now
a = controller->GetRawButton(1);
if(a){
motor1->Set(0.5);
}
Now I just gave you examples. You need to put them in the right places though:
Code:
//The bool goes into the robot init
//The joystick definition goes in the private section of the robot class
//And the code to execute it goes in telopPeriodic
ONLY IF YOU ARE USING A ITERITIVE!!!
Reply With Quote