mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[wpilib] Deprecate Accelerometer and Gyro interfaces (#5445)
Accelerometer is hyper-specific to ADXL accelerometers, and Gyro is less useful now that 3D IMUs are prevalent, and if those IMUs want to support the Gyro interface, they also need to provide a way to set the axis used for the Gyro interface, which is confusing. Higher-order functions (e.g., lambdas) are a more flexible interface boundary than interfaces, but they didn't exist when these interfaces were created.
This commit is contained in:
@@ -15,7 +15,7 @@ namespace frc::sim {
|
||||
TEST(ADXL345SimTest, SetSpiAttributes) {
|
||||
HAL_Initialize(500, 0);
|
||||
|
||||
ADXL345_SPI accel(SPI::kMXP, Accelerometer::kRange_2G);
|
||||
ADXL345_SPI accel(SPI::kMXP, ADXL345_SPI::kRange_2G);
|
||||
ADXL345Sim sim(accel);
|
||||
|
||||
EXPECT_EQ(0, accel.GetX());
|
||||
|
||||
Reference in New Issue
Block a user