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