Files
allwpilib/wpilibcExamples/src/main/cpp/examples/DigitalCommunication/include/Robot.hpp
Peter Johnson 5c9c45fadb [cscore, wpilibcExamples] Use double-quote includes for wpi/ (#8346)
Use ERR and WARN in cscore to avoid conflict with Windows headers.
2025-11-08 16:58:51 -08:00

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};
};