This repository has been archived on 2024-12-15. You can view files and clone it, but cannot push or open issues or pull requests.
qEcho/source/distancethread.h

28 lines
400 B
C
Raw Normal View History

2017-10-15 10:30:15 +00:00
#pragma once
#include <vector>
2017-10-15 10:30:15 +00:00
#include <QThread>
class DistanceThread : public QThread
{
Q_OBJECT
private:
const int m_triggerPin = 28;
const int m_echoPin = 29;
public:
DistanceThread();
protected:
void run() override;
private:
template<typename VALUE_TYPE>
double median(std::vector<VALUE_TYPE> values) const;
2017-10-15 10:30:15 +00:00
signals:
void distanceUpdated(double distMeters);
};