Sentinel
Loading...
Searching...
No Matches
accelerometer.h
Go to the documentation of this file.
1
8
9#ifndef ACCELEROMETER_H
10#define ACCELEROMETER_H
11
12#include <Arduino.h>
13#include <MPU6500_WE.h>
14#include <Wire.h>
15#include "config.h"
16
21
23{
24private:
25 MPU6500_WE accel = MPU6500_WE();
26 xyzFloat values;
27 int steps;
28 float accelZ;
29 float accelTotal;
30 float accelPitch;
31 float accelRoll;
32
33public:
34 bool begin();
35 void setup();
36 void update();
37 float getZ() const;
38 float getTotal() const;
39 float getPitch() const;
40 float getRoll() const;
41};
42
43#endif
Class for the accelerometer sensor.
Definition accelerometer.h:23
void update()
Updates the accelerometer values.
Definition accelerometer.cpp:58
float getZ() const
Gets the Z value from the accelerometer.
Definition accelerometer.cpp:75
float getTotal() const
Gets the total acceleration from the accelerometer.
Definition accelerometer.cpp:86
bool begin()
Initializes the MPU6500 sensor.
Definition accelerometer.cpp:23
float getPitch() const
Gets the pitch from the accelerometer.
Definition accelerometer.cpp:96
void setup()
Initializes the MPU6500 sensor with default settings.
Definition accelerometer.cpp:40
float getRoll() const
Gets the roll from the accelerometer.
Definition accelerometer.cpp:106
Configuration Header File.