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.cpp

19 lines
284 B
C++

#include "distancethread.h"
DistanceThread::DistanceThread(unsigned int triggerPin, unsigned int echoPin)
: m_hcsr04(triggerPin, echoPin)
{
}
void DistanceThread::run()
{
m_hcsr04.run();
while (true)
{
emit distanceUpdated(m_hcsr04.getDistance());
msleep(100);
}
}