WPILibC++ 2025.0.0-alpha-1-9-ga2beb75
ADXL345Sim.h
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
7#include <hal/SimDevice.h>
8
9namespace frc {
10
11class ADXL345_SPI;
12class ADXL345_I2C;
13
14namespace sim {
15
16/**
17 * Class to control a simulated ADXL345.
18 */
20 public:
21 /**
22 * Constructs from a ADXL345_I2C object.
23 *
24 * @param accel ADXL345 accel to simulate
25 */
26 explicit ADXL345Sim(const ADXL345_I2C& accel);
27
28 /**
29 * Constructs from a ADXL345_SPI object.
30 *
31 * @param accel ADXL345 accel to simulate
32 */
33 explicit ADXL345Sim(const ADXL345_SPI& accel);
34
35 /**
36 * Sets the X acceleration.
37 *
38 * @param accel The X acceleration.
39 */
40 void SetX(double accel);
41
42 /**
43 * Sets the Y acceleration.
44 *
45 * @param accel The Y acceleration.
46 */
47 void SetY(double accel);
48
49 /**
50 * Sets the Z acceleration.
51 *
52 * @param accel The Z acceleration.
53 */
54 void SetZ(double accel);
55
56 private:
57 hal::SimDouble m_simX;
58 hal::SimDouble m_simY;
59 hal::SimDouble m_simZ;
60};
61
62} // namespace sim
63} // namespace frc
ADXL345 Accelerometer on I2C.
Definition: ADXL345_I2C.h:27
ADXL345 Accelerometer on SPI.
Definition: ADXL345_SPI.h:22
Class to control a simulated ADXL345.
Definition: ADXL345Sim.h:19
void SetY(double accel)
Sets the Y acceleration.
void SetZ(double accel)
Sets the Z acceleration.
ADXL345Sim(const ADXL345_I2C &accel)
Constructs from a ADXL345_I2C object.
void SetX(double accel)
Sets the X acceleration.
ADXL345Sim(const ADXL345_SPI &accel)
Constructs from a ADXL345_SPI object.
C++ wrapper around a HAL simulator double value handle.
Definition: SimDevice.h:536
Definition: AprilTagDetector_cv.h:11