Closed Daltz333 closed 3 years ago
Shouldn't addPeriodic()
calls be in robotInit()
and not the constructor?
And how would they access subsystem objects (that are encapsulated in RobotContainer
)?
I'm not sure. I just copied @calcmogul example.
Shouldn't addPeriodic() calls be in robotInit() and not the constructor?
Either one works. I prefer using the constructor for its intended purpose.
If you're using command-based, you don't need addPeriodic() because CommandScheduler is doing the scheduling instead of TimedRobot's Notifier. You'll need the scheduler Run() function to run at the rate of your fastest command (like a feedback controller).
Most of the example work is already done, see
Just need someone to turn this into an article and place it into some appropriate section. I think making a "Convenience Features" section under "Advanced Programming" would be great for this and some other miscellaneous articles.