From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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
(4,506 Views)
Solution
Accepted by topic author 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
(4,498 Views)

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

0 Kudos
Message 3 of 7
(4,490 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
(4,488 Views)

Dear ,

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

0 Kudos
Message 5 of 7
(4,091 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
(4,089 Views)

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

0 Kudos
Message 7 of 7
(4,079 Views)