![]() |
Forum Index : Microcontroller and PC projects : Flashing a LED.
Author | Message | ||||
Phil23 Guru ![]() Joined: 27/03/2016 Location: AustraliaPosts: 1667 |
Ok, Not quite going back to basics, I know how to flash one in a manner that takes time out... [Code]Pin(Led1)=1 : Pause 200 : Pin(Led1)[/code] Or to do it without the Pause holding up stuff you could use [Code]Pulse Led1,200[/code] But what about with Advanced Graphics. [Code]GUI LED #ref, caption$, CenterX, CenterY, Radius, Colour[/code] I want 2 LEDS for Coms acknowledgment; would be good if they could stay on for 1/2 a second. Any suggestions? Thanks Phil. |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6269 |
Your first version using PAUSE will PAUSE your program for the on time. PULSE will run in the background. This makes it the best choice if you want the main program to keep running. I tend to turn the led on and then, later in the program, turn it off. If you turn it on at the start of a routine and of at the end, you have a visual indication of the time the routine is taking. This can be handy. Jim VK7JH MMedit |
||||
Phil23 Guru ![]() Joined: 27/03/2016 Location: AustraliaPosts: 1667 |
Thanks Jim, It's the GUI LED I'm trying to pulse. At the moment I's inverting it very time coms is received from a device. Tried on at the beginning & off at the end of the coms routines, but it happens too fast. At the moment Coms are polling every 2 seconds, so it the GUI LED doesn't get stuck either on or off for a long period it gives a debug indication that coms is happening. What's happening at the moment is the Master alternatively polls either the heat pump or the spa every 2 seconds, alternating between them. Cheers Phil. |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
You can use a timer with interrupt. Microblocks. Build with logic. |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2932 |
Hi Phil, Can you turn the GUI LED on when required, and at the same time set a SETTICK. Then when the SETTICK 'expires' simply switch of the GUI LED (and disable the SETTICK). This allows program to keep running with only the single triggering of the SETTICK 'disturbing' your main program. WW |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |