Files
allwpilib/wpilibcExamples/src/main/cpp/snippets/DigitalCommunication/include/Robot.hpp
Gold856 f1adce4cf7 [examples] Clean up examples (#8674)
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.
2026-03-14 14:13:45 -07: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};
};