// 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.

#include "wpi/framework/TimedRobot.hpp"
#include "wpi/hardware/discrete/DigitalInput.hpp"

/**
 * Digital Input snippets for wpilib-docs.
 * https://docs.wpilib.org/en/stable/docs/software/hardware-apis/sensors/digital-input-software.html
 */
class Robot : public wpi::TimedRobot {
 public:
  void TeleopPeriodic() override {
    // Gets the value of the digital input.  Returns true if the circuit is
    // open.
    input.Get();
  }

 private:
  // Initializes a DigitalInput on DIO 0
  wpi::DigitalInput input{0};
};

#ifndef RUNNING_WPILIB_TESTS
int main() {
  return wpi::StartRobot<Robot>();
}
#endif
