MRAS
Multi Rocket Avionics System
Loading...
Searching...
No Matches
Sensor_LIS3MDL.h
1//
2// Created by Tom Danvers on 17/12/2022.
3//
4
5#ifndef MRAS_SENSOR_LIS3MDL_H
6#define MRAS_SENSOR_LIS3MDL_H
7
8
9#include "Subsystem.h"
10#include "Arduino.h"
11#include "SPI.h"
12#include "LIS3MDL.h"
13#include "system_messages/MagnetometerDataMsg.h"
14
15
23class Sensor_LIS3MDL : public Subsystem {
24private:
25 LIS3MDL::LIS3MDL *lis;
26public:
35 Sensor_LIS3MDL(uint8_t id, uint8_t chip_select,
36 SPIClass &spi, uint32_t frequency)
37 : Subsystem(id) {
38 lis = new LIS3MDL::LIS3MDL(chip_select, spi, frequency);
39 }
40
42 delete lis;
43 }
44
45 int8_t setup() override;
46
47 int8_t loop() override;
48
49 SUBSYSTEM_NAME("LIS3MDL")
50 SUBSYSTEM_NO_MESSAGE_HANDLER
51};
52
53
54#endif //MRAS_SENSOR_LIS3MDL_H
A subsystem for the LIS3MDL magnetometer.
Definition: Sensor_LIS3MDL.h:23
Sensor_LIS3MDL(uint8_t id, uint8_t chip_select, SPIClass &spi, uint32_t frequency)
Construct a new Sensor_LIS3MDL object.
Definition: Sensor_LIS3MDL.h:35
Definition: Subsystem.h:30