mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Move various "examples" into snippets. Several examples that were less than a full mechanism or robot were moved to snippets. `arcadedrive` and `tankdrive` were removed in favor of their Gamepad variants. `hidrumble` was removed due to being too simple. `potentiometerpid` was removed because of low utility. `gyromecanum` replaced `mecanumdrive` for deduplication and because very few teams run holonomic drivetrains without gyros.
32 lines
1001 B
C++
32 lines
1001 B
C++
// Copyright (c) FIRST and other WPILib contributors.
|
|
// Open Source Software; you can modify and/or share it under the terms of
|
|
// the WPILib BSD license file in the root directory of this project.
|
|
|
|
#pragma once
|
|
|
|
#include <array>
|
|
|
|
#include "wpi/framework/TimedRobot.hpp"
|
|
#include "wpi/hardware/discrete/DigitalOutput.hpp"
|
|
|
|
/**
|
|
* This is a sample program demonstrating how to communicate to a light
|
|
* controller from the robot code using the roboRIO's DIO ports.
|
|
*/
|
|
class Robot : public wpi::TimedRobot {
|
|
public:
|
|
// define ports for communication with light controller
|
|
static constexpr int kAlliancePort = 0;
|
|
static constexpr int kEnabledPort = 1;
|
|
static constexpr int kAutonomousPort = 2;
|
|
static constexpr int kAlertPort = 3;
|
|
|
|
void RobotPeriodic() override;
|
|
|
|
private:
|
|
wpi::DigitalOutput m_allianceOutput{kAlliancePort};
|
|
wpi::DigitalOutput m_enabledOutput{kEnabledPort};
|
|
wpi::DigitalOutput m_autonomousOutput{kAutonomousPort};
|
|
wpi::DigitalOutput m_alertOutput{kAlertPort};
|
|
};
|