LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to turn 12 LED on

lets say i have 12 LED for 12 hour indication.

one LED should on for one hour and next led for next hour say like

LED_1 should remain on from 8am to 9am

LED_2 should remain on from 9am to 10am and so on.

i can make this but to compare each time stamp for each hour. its so big coding.

please tell how to do with other way like using loop.

 

Thanks,

 

0 Kudos
Message 1 of 6
(2,586 Views)

You can use a quotient and remainder for this. If you use the time as x, and 12 as y, you'll get 0-11 as remainder. If you put the 12 LEDs in an array, you can simply replace that index in an array of false booleans with a true.

0 Kudos
Message 2 of 6
(2,577 Views)

Use the Seconds To Date/Time and then unbundle the hour.  From there you can just use a constant of 12 FALSEs and Replace Array Subset to put the TRUE where it needs to go.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 6
(2,576 Views)

Seconds to Date\Time has the benefit that it returns he local hour. But you still get 0-23. So use a q&r with a 12 to get 0-11.

0 Kudos
Message 4 of 6
(2,571 Views)

sorry difficult to understand for me.  😞

 

can you please write code?

 

thanks

0 Kudos
Message 5 of 6
(2,559 Views)

@Asif138 wrote:

can you please write code?


We are not here to do your homework.  We gave you step-by-step instructions.  Give it a try.  When you run into issues, post your code and tell us what is stopping you.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 6
(2,550 Views)