hi
i want to toggle LED for 5 seconds like ON and OFF. with 1 hz rate... can anyone give me suggestion..how to do that??
thanks
Sammey
hi
i want to toggle LED for 5 seconds like ON and OFF. with 1 hz rate... can anyone give me suggestion..how to do that??
thanks
Sammey
Write code that will be triggered once a second (e.g. using a timer) that toggles the led.
How are you controlling the LED ? Qt cannot do that directly.
For the logic,,
Qt Code:
myclass::myclass() { timer.setInterval(1000); // 1Hz = 1 sec } void startBlinkLED() { timer.start() count = 0; } void onTimerTimeout() { if( count++ > 5) { count = 0; timer.stop(); return; } led->blink(); // Actual API to be called }To copy to clipboard, switch view to plain text mode
i work on linux platform
for turning on led system("echo 1 > /sys/class/leds/highbright-led/brightness")
and turning off system("echo 0 > /sys/class/leds/highbright-led/brightness")
anyway tanx for the reply aamer4yu ..i wil make some changes and i will check whether it is working or not...![]()
sammey,
It is unusual perform control of hardware devices at X86 platform, as was implicitly mentioned by aamer4yu.
I presume you are working on some embedded linux platform such as an ARM one.
If the case, take a look on source code examples which is commonly provided at design tool ( hello word / blink led / etc... )
+++
Bookmarks