WPILibC++ 2027.0.0-alpha-2
Loading...
Searching...
No Matches
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_I2C;
12
13namespace sim {
14
15/**
16 * Class to control a simulated ADXL345.
17 */
19 public:
20 /**
21 * Constructs from a ADXL345_I2C object.
22 *
23 * @param accel ADXL345 accel to simulate
24 */
25 explicit ADXL345Sim(const ADXL345_I2C& accel);
26
27 /**
28 * Sets the X acceleration.
29 *
30 * @param accel The X acceleration.
31 */
32 void SetX(double accel);
33
34 /**
35 * Sets the Y acceleration.
36 *
37 * @param accel The Y acceleration.
38 */
39 void SetY(double accel);
40
41 /**
42 * Sets the Z acceleration.
43 *
44 * @param accel The Z acceleration.
45 */
46 void SetZ(double accel);
47
48 private:
49 hal::SimDouble m_simX;
50 hal::SimDouble m_simY;
51 hal::SimDouble m_simZ;
52};
53
54} // namespace sim
55} // namespace frc
ADXL345 Accelerometer on I2C.
Definition ADXL345_I2C.h:23
Class to control a simulated ADXL345.
Definition ADXL345Sim.h:18
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.
C++ wrapper around a HAL simulator double value handle.
Definition SimDevice.h:536
Definition SystemServer.h:9