[hal, wpilib] Remove built in accelerometer (#7702)

This commit is contained in:
Thad House
2025-01-17 14:06:09 -08:00
committed by GitHub
parent 1600e773f4
commit 5a6c895b87
48 changed files with 0 additions and 2304 deletions

View File

@@ -1,50 +0,0 @@
// 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 "glass/hardware/Accelerometer.h"
#include "glass/DataSource.h"
#include "glass/other/DeviceTree.h"
using namespace glass;
void glass::DisplayAccelerometerDevice(AccelerometerModel* model) {
if (!model->Exists()) {
return;
}
if (BeginDevice("BuiltInAccel")) {
// Range
{
int value = model->GetRange();
static const char* rangeOptions[] = {"2G", "4G", "8G"};
DeviceEnum("Range", true, &value, rangeOptions, 3);
}
// X Accel
if (auto xData = model->GetXData()) {
double value = xData->GetValue();
if (DeviceDouble("X Accel", false, &value, xData)) {
model->SetX(value);
}
}
// Y Accel
if (auto yData = model->GetYData()) {
double value = yData->GetValue();
if (DeviceDouble("Y Accel", false, &value, yData)) {
model->SetY(value);
}
}
// Z Accel
if (auto zData = model->GetZData()) {
double value = zData->GetValue();
if (DeviceDouble("Z Accel", false, &value, zData)) {
model->SetZ(value);
}
}
EndDevice();
}
}