Led blinking


Recommended Posts

The easiest way is to actually use a symbol control and use the blink expression to make it blink. The blink rate is determined by the refresh rate of the screen. If you want to script it, you'd need to create a variable that the LED component displays the status of, and then toggle that variable. So, let's say you have an input channel called MyChannel, and you want the LED to be off when MyChannel is 0 and blink when MyChannel is anything else. Use something like this:

global myChannelBlink = 0
read(myChannel) // ensure we have a value read
while(1)
   if (myChannel[0]) 
	  myChannelBlink = 1
   endif
   delay(0.5)
   myChannelBlink = 0
   delay(0.5)
endwhile

Then have the LED component look at myChannelBlink for its state

Link to comment
Share on other sites

  • 5 months later...

Archived

This topic is now archived and is closed to further replies.