|
Re: Robot Code Problem ** Again**
Quote:
Originally Posted by AWoL
Doing them in the periodic loop definitely isn't smart, as you want that loop to run as fast as possible, and creating 22 new objects every couple of milliseconds or so is a sure fire way to slow down the speed at which driver commands will be processed and to give the roboRIO memory issues.
|
Adam is right - you should only be creating the JoystickButton object once for each object and calling the method to bind to a command once (whenPressed, etc)
The command you specified will be automatically triggered as long as you are running the Scheduler every teleop loop
__________________
2012-2014: 225 Driver, Programmer & Co-Captain
2012-2014: FTC 4977 Driver, Programmer, & Team Captain
2011: 225 Operator & Programmer
2013: FRC: Springside-Chestnut Hill Winner (w/341 & 1495), Midknight Mayhem Winner (w/316, 369, & 869), Battle O' Baltimore Winner (w/1640, 2914 & 339), Duel on the Delaware Finalist (w/816 & 369), Ramp Riot Winner (w/341, 304, & 4637) FTC: PA State Finalist
2014: FRC: Springside-Chestnut Hill Winner (w/316 & 1495), Greater DC Winner (w/1731 & 4464), Midknight Mayhem Winner (w/25, 1626 & 329) FTC: PA State Champion
|