SkyPulse UAV V0.1
Loading...
Searching...
No Matches
magnetometer_gy271.h
Go to the documentation of this file.
1#ifndef MAGNETOMETER_GY271_H
2#define MAGNETOMETER_GY271_H
3
4#include <QObject>
5#include <QThread>
6#include <QByteArray>
7#include "i2c_device.h"
8
9class Magnetometer_GY271 : public QObject
10{
11 Q_OBJECT
12
13public:
14 explicit Magnetometer_GY271(uint8_t i2cAddress = 0x0D, QObject *parent = nullptr);
15 bool initializeGY271();
16
17public slots:
18 void readRawData();
19
20private:
21 I2C_Device *i2cDevice;
22 bool writeByte(uint8_t reg, uint8_t value);
23 int16_t convertToRawData(const QByteArray &bytes, int offset);
24
25private slots:
26 void handleI2CError(QString error);
27
28signals:
29 void sig_rawDataRead(int x, int y, int z);
30 void sig_errorOccurred(const QString&error);
31};
32
33#endif // MAGNETOMETER_GY271_H
Definition i2c_device.h:8
Definition magnetometer_gy271.h:10
void sig_errorOccurred(const QString &error)
void sig_rawDataRead(int x, int y, int z)
void readRawData()
Definition magnetometer_gy271.cpp:39
bool initializeGY271()
Definition magnetometer_gy271.cpp:21
Magnetometer_GY271(uint8_t i2cAddress=0x0D, QObject *parent=nullptr)
Definition magnetometer_gy271.cpp:4