取消
显示结果 
搜索替代 
您的意思是: 

Blinking LEDS with numeric control

已解决!
转到解答

Hello,

 

I want to make a simple program that goes like this. I will have 2 numeric controls and 2 comparisons. 1st numeric will compare if the number if less than 50. Second comparison if it's greater that 50. If less than  50, the LED according to that number will blink up and stay on. If the second number is greater than 50 then the LED belonging to that number will blink and stay on. NOW...

 

If either OR both of these lights turn on, a THIRD light should BLINK off and on automatically. if both the first two lights stay off, then the third should stay off.

 

I tried to use shift registers and a delay to get the delaying but i'm stuck.

 

Any help would be great. Thank you !

 

Thuba25

0 项奖励
1 条消息(共 8 条)
5,878 次查看
解答
接受人 Thuba25

FIrst you need to change your code to a real interactive state machine. Your code is inside-out.

Currently the controls are read once at the start of the program and then never again.

 

  • Don't use inner loops. Use a single outer WHILE loop encompassing all code.
  • Get rid of the stacked sequence, it is pointless and just obscures the code.
  • The case structure belongs inside the loop and not vice versa.
  • Read the controls with every iteration and decide according to their value.
  • ...

See how far you get.... Good luck.

2 条消息(共 8 条)
5,861 次查看

There is the property Blinking...



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
3 条消息(共 8 条)
5,860 次查看

Thank you for your help! I was wondering, how do you get the property node you were talking about ?

0 项奖励
4 条消息(共 8 条)
5,851 次查看

@Thuba25 wrote:

Thank you for your help! I was wondering, how do you get the property node you were talking about ?


Right-click on your LED and select Create->Property Node->Blinkning.



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
5 条消息(共 8 条)
5,849 次查看

I would actually blink it programmatically instead of with a property node. You have better control over rate and blink color.

 

Here's a quick draft. Modify as needed.

 

下载全部
6 条消息(共 8 条)
5,841 次查看

I'm having trouble with this VI. Would you mind posting the one you created? Thank you

0 项奖励
7 条消息(共 8 条)
5,836 次查看

Which one is "this vi"?

 

Tim's VI is a snippet. Just download the image and drag it to the block diagram. It will turn into runnable code automagically. 😄

8 条消息(共 8 条)
5,831 次查看