24 lines
372 B
C++
24 lines
372 B
C++
#include "ampel.h"
|
|
#include <unistd.h>
|
|
|
|
Ampel::Ampel() {
|
|
this->running = 1;
|
|
}
|
|
void Ampel::setStop() {
|
|
this->running = 0;
|
|
}
|
|
|
|
void Ampel::run() {
|
|
int anzahl = 0;
|
|
while (this->running) {
|
|
anzahl++;
|
|
if (anzahl < 6) {
|
|
usleep(800000);
|
|
}
|
|
else {
|
|
usleep(1400000);
|
|
}
|
|
emit ampelUpdate();
|
|
}
|
|
}
|