mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[hal, wpilib] Update Addressable LED support (#8100)
This commit is contained in:
@@ -6,10 +6,8 @@
|
||||
|
||||
Robot::Robot() {
|
||||
// Default to a length of 60, start empty output
|
||||
// Length is expensive to set, so only set it once, then just update data
|
||||
m_led.SetLength(kLength);
|
||||
m_led.SetData(m_ledBuffer);
|
||||
m_led.Start();
|
||||
}
|
||||
|
||||
void Robot::RobotPeriodic() {
|
||||
|
||||
@@ -18,9 +18,8 @@ class Robot : public frc::TimedRobot {
|
||||
private:
|
||||
static constexpr int kLength = 60;
|
||||
|
||||
// PWM port 9
|
||||
// Must be a PWM header, not MXP or DIO
|
||||
frc::AddressableLED m_led{9};
|
||||
// SmartIO port 1
|
||||
frc::AddressableLED m_led{1};
|
||||
std::array<frc::AddressableLED::LEDData, kLength>
|
||||
m_ledBuffer; // Reuse the buffer
|
||||
|
||||
|
||||
Reference in New Issue
Block a user