2020-12-26 14:12:05 -08: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.
|
2017-08-18 21:35:53 -07:00
|
|
|
|
2018-07-20 00:03:45 -07:00
|
|
|
#include "hal/Accelerometer.h"
|
2017-08-18 21:35:53 -07:00
|
|
|
|
2018-07-20 00:03:45 -07:00
|
|
|
#include "mockdata/AccelerometerDataInternal.h"
|
2017-08-18 21:35:53 -07:00
|
|
|
|
|
|
|
|
using namespace hal;
|
|
|
|
|
|
2020-12-28 01:19:59 -08:00
|
|
|
namespace hal::init {
|
2017-12-10 19:38:53 -08:00
|
|
|
void InitializeAccelerometer() {}
|
2020-12-28 01:19:59 -08:00
|
|
|
} // namespace hal::init
|
2017-12-10 19:38:53 -08:00
|
|
|
|
2017-08-18 21:35:53 -07:00
|
|
|
extern "C" {
|
|
|
|
|
void HAL_SetAccelerometerActive(HAL_Bool active) {
|
2018-09-03 16:08:07 -07:00
|
|
|
SimAccelerometerData[0].active = active;
|
2017-08-18 21:35:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HAL_SetAccelerometerRange(HAL_AccelerometerRange range) {
|
2018-09-03 16:08:07 -07:00
|
|
|
SimAccelerometerData[0].range = range;
|
2017-08-18 21:35:53 -07:00
|
|
|
}
|
2020-12-28 12:58:06 -08:00
|
|
|
double HAL_GetAccelerometerX(void) {
|
|
|
|
|
return SimAccelerometerData[0].x;
|
|
|
|
|
}
|
|
|
|
|
double HAL_GetAccelerometerY(void) {
|
|
|
|
|
return SimAccelerometerData[0].y;
|
|
|
|
|
}
|
|
|
|
|
double HAL_GetAccelerometerZ(void) {
|
|
|
|
|
return SimAccelerometerData[0].z;
|
|
|
|
|
}
|
2017-10-16 19:56:08 -07:00
|
|
|
} // extern "C"
|