qEcho/source/blinkthread.cpp

22 lines
286 B
C++
Raw Normal View History

2017-10-15 10:30:15 +00:00
#include "blinkthread.h"
#include "led.h"
2017-10-15 10:30:15 +00:00
BlinkThread::BlinkThread(unsigned int pin)
: m_led(pin)
2017-10-15 10:30:15 +00:00
{
}
void BlinkThread::run()
{
while (true)
{
m_led.on();
2017-10-15 10:30:15 +00:00
emit ledOn();
msleep(500);
2017-10-15 10:30:15 +00:00
m_led.off();
2017-10-15 10:30:15 +00:00
emit ledOff();
msleep(500);
2017-10-15 10:30:15 +00:00
}
}