2023-01-09 02:33:53 +02:00
|
|
|
// 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>
|
|
|
|
|
|
2025-11-07 19:56:21 -05:00
|
|
|
#include "wpi/hardware/bus/I2C.hpp"
|
|
|
|
|
#include "wpi/opmode/TimedRobot.hpp"
|
2023-01-09 02:33:53 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This is a sample program demonstrating how to communicate to a light
|
|
|
|
|
* controller from the robot code using the roboRIO's I2C port.
|
|
|
|
|
*/
|
|
|
|
|
class Robot : public frc::TimedRobot {
|
|
|
|
|
public:
|
|
|
|
|
void RobotPeriodic() override;
|
|
|
|
|
|
2025-04-28 08:29:01 -07:00
|
|
|
static constexpr frc::I2C::Port kPort = frc::I2C::Port::kPort0;
|
2023-01-09 02:33:53 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
static constexpr int deviceAddress = 4;
|
|
|
|
|
frc::I2C arduino{kPort, deviceAddress};
|
|
|
|
|
};
|