View Single Post
  #1   Spotlight this post!  
Unread 08-02-2014, 19:27
TPackard TPackard is offline
Registered User
FRC #0008
 
Join Date: Feb 2014
Location: Palo Alto
Posts: 4
TPackard is an unknown quantity at this point
Timers don't start

Our team has been having trouble with the WPILib Timer class, since the Get() method always returns 0.

Code:
void Fenrir::AutonomousInit() {
    timer.Start();
}

void Fenrir::AutonomousPeriodic() {
    std::printf("%f\n", timer.Get());
}
timer is an instance variable of Fenrir, which is our main robot class that inherits from IterativeRobot. When we run the above code, it constantly prints 0 and never changes. We've also tried using the HasPeriodPassed() and GetFPGATimestamp() methods, but they don't work either. What could the problem be?

Thanks in advance!
Reply With Quote