ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Momentary button to toggle LED - LabVIEW FPGA

Solved!
Go to solution

I have started to learn something with hardware (cRio starter kit).  I want to implement what is called "memory" in motor control  that is when I press a push button (PS1), the LED (LED1) will change its state and stay until PB1 is pressed again.  I tried to implement it but failed completely.  It should be done with a register but I just could not keep it from blinking.  

0 Kudos
Message 1 of 7
(5,944 Views)
Solution
Accepted by muahang1234

Hi muahang,

 

use a shift register to keep the previous state of the button. Compare the current state of the button with it's previous one. When you detect a rising edge you invert the boolean value of a second shift register. Write the boolean from the second shift register to your LED...

check.png

 

Keywords: boolean, rising edge detection, shift register

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 7
(5,936 Views)

Thank you very much.  I never thought about using the second shift register to achieve it.

0 Kudos
Message 3 of 7
(5,928 Views)

Why didn't you think of using a second shift register? 😄

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 7
(5,926 Views)

Dear ,

I can't see the picture. Can you share it again?

0 Kudos
Message 5 of 7
(5,529 Views)

Hi Ayse,

 

no, I cannot reattach that picture. It's long time ago.

 

But from my description it's quite easy to recreate it from scratch:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 7
(5,527 Views)

🙂 Thank you very much. I am new at Labview so I can't visualize it

0 Kudos
Message 7 of 7
(5,517 Views)