PLUS+1 Software > Code sharing

Button latch and toggle

(1/2) > >>

Mike AA:
having a bit of difficulty figuring out a latch and toggle setup. I figured out how to do a simple latch toggle with a data flip-flop that turns on with one press turns off with another press, works well. I have a setup where I am trying to set my travel speed with a trigger pulled for 3 seconds then use the same trigger to then click once to engage the drives. The problem I am having is with my initial code the drive would enable or disable depending on its previous state when holding the trigger. I added another toggle setup to latch at the end of the 3 seconds which then enables the enable/disable toggle. but then I go to reset the speed this toggles the 3 second latch and shuts it off until I do a reset speed hold again.

Attached is my attempt so far.

Anyone have ideas to do all this with only one button?


Something like this might do the trick.


Mike AA:

This should work. I think I started to do this exact setup but missed the NOT so it didn't work and frustrated me. I will get this loaded this morning yet and see what it does.


Mike AA:

Unfortunately this code is doing what I had trouble with before. You can hold and set and release and it will turn on at set speed, thats good. If you need to adjust speed, so hold and release it will then shut down. I am starting to think using one button for this function isn't going to work.

Anyone else have any ideas to make this functionality work?

Hi Mikeaa12!

It sound like you're trying to create a cruise control? Hold button for 3s to activate it, set speed with one press. I hope the attached picture could be something for you then!

Best regards
PLUS+1 Helpdesk


[0] Message Index

[#] Next page

Go to full version