Loom 4 v4.5
Arduino library for Internet of Things Rapid Prototyping in environmental sensing
Loading...
Searching...
No Matches
Loom_MPU6050.h
1#pragma once
2
3#include "../I2CDevice.h"
4#include "Loom_Manager.h"
5
6#include <Wire.h>
7#include <MPU6050_tockn.h>
8
14class Loom_MPU6050 : public I2CDevice{
15 protected:
16
17 void power_up() override {};
18 void power_down() override {};
19
20 public:
21 Loom_MPU6050(Manager& man, bool useMux = false, const bool autoCalibrate = true);
22
23 void initialize() override;
24 void measure() override;
25 void package() override;
26
30 void calibrate();
31
32 private:
33 Manager* manInst; // Instance of the manager
34 MPU6050 mpu; // Instance of the MPU sensor library
35 bool autoCali; // Whether or not to auto calibrate on startup
36
37 float acc[3]; // Acceleration of the gyroscope
38 float rate[3]; // Rate of rotation in degrees/second
39 float angle[3]; // Angle of the gyroscope
40};
Definition: I2CDevice.h:6
Definition: Loom_MPU6050.h:14
void calibrate()
Definition: Loom_MPU6050.cpp:71
Definition: Loom_Manager.h:18