mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Updated the HAL library to work with the new version 3 headers from NI. There were multiple changes in this verison: more PWM generators were added, so the functions for setting PWM signals have been updated. UserWatchdog has been removed, and Watchdog has been removed from WPILib to accomodate for this. Digital selection has been consolidated to one function in the NI headers, so this has been updated in the HAL. New SPI and I2C libraries have been added, but need to be implemented in the HAL before they will work.
51 lines
866 B
C++
51 lines
866 B
C++
#include "WPILib.h"
|
|
#include "Commands/Command.h"
|
|
#include "Commands/ExampleCommand.h"
|
|
#include "CommandBase.h"
|
|
|
|
class Robot: public IterativeRobot
|
|
{
|
|
private:
|
|
Command *autonomousCommand;
|
|
LiveWindow *lw;
|
|
|
|
void RobotInit()
|
|
{
|
|
CommandBase::init();
|
|
autonomousCommand = new ExampleCommand();
|
|
lw = LiveWindow::GetInstance();
|
|
}
|
|
|
|
void AutonomousInit()
|
|
{
|
|
autonomousCommand->Start();
|
|
}
|
|
|
|
void AutonomousPeriodic()
|
|
{
|
|
Scheduler::GetInstance()->Run();
|
|
}
|
|
|
|
void TeleopInit()
|
|
{
|
|
// This makes sure that the autonomous stops running when
|
|
// teleop starts running. If you want the autonomous to
|
|
// continue until interrupted by another command, remove
|
|
// this line or comment it out.
|
|
autonomousCommand->Cancel();
|
|
}
|
|
|
|
void TeleopPeriodic()
|
|
{
|
|
Scheduler::GetInstance()->Run();
|
|
}
|
|
|
|
void TestPeriodic()
|
|
{
|
|
lw->Run();
|
|
}
|
|
};
|
|
|
|
START_ROBOT_CLASS(Robot);
|
|
|