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

17 lines
269 B
C++

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