mirror of
http://172.16.0.230/r/SIF/TowerOptoSifAndSpectral.git
synced 2025-10-19 03:49:42 +08:00
添加了 温湿度传感器控制代码 已能读取 等待拷机测试
This commit is contained in:
23
source/Misc_Detector/GY39Controller.h
Normal file
23
source/Misc_Detector/GY39Controller.h
Normal file
@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
#include "pch.h"
|
||||
class GY39Controller :public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
GY39Controller(QObject* parent = nullptr);
|
||||
~GY39Controller();
|
||||
private:
|
||||
int SendCommand(QByteArray qbCommand);
|
||||
int RecvHumitureData(QByteArray &qbData);
|
||||
int ParseHumitureData(QByteArray &qbData);
|
||||
public:
|
||||
int Initialize(std::string ucPortName,bool bAuto15 = false,bool bAuto45 = false);
|
||||
int GetHumiture(float &fTemp, float &fHum);
|
||||
public slots:
|
||||
signals:
|
||||
|
||||
private:
|
||||
int m_iBaudRate;
|
||||
QSerialPort *m_pSerialPort;
|
||||
float m_fTemperature, m_fHumidity;
|
||||
};
|
Reference in New Issue
Block a user