FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Labview (Coding Help) One button inverses/un-inverses controls?

Solved!
Go to solution

Labview (Coding Help) One button inverses/un-inverses controls?

So I don't know if this is what this forum is for, but as one of two coders in my team (+ the main one), I really get pressured by my team to make everything work, and I can't figure something out for the life of me!

 

So here's what my team wants:

-One button (In our case button 3 [Y]) needs to invert axes X and Y in our drive system when pressed, until pressed again.

 

I've tried about 10 times so far and every time I either ruin the code and the robot freezes, or we have to hold Y.

I've tried the RS Bistable Flip Flop vi, but maybe I just dont know how to use it???

 

Thank you all and sorry I can't code xD,

Team 5411

0 Kudos
Message 1 of 11
(342 Views)
Solution
Accepted by topic author JacksonS.
02-11-2019 03:07 PM

Re: Labview (Coding Help) One button inverses/un-inverses controls?

I think this site works really well when I want to figure out some button actions.

 

Team 358 LabVIEW Programming - http://team358.org/files/programming/ControlSystem2009-/LabVIEW/

 

I'd looks for "Button Toggle Action (2014)" to get what you want.

JY
AE Specialist, RF and Communications
National Instruments
Message 2 of 11
(333 Views)

Re: Labview (Coding Help) One button inverses/un-inverses controls?

I agree with JY,

 

I would use a Toggle to switch between the two behaviors (as describes here: Use Joystick Button to Toggle Between Cases Using LabVIEW for FRC) and then would make one of the cases switch the inputs (maybe negating them too...).

 

Regards,

Message 3 of 11
(328 Views)

Re: Labview (Coding Help) One button inverses/un-inverses controls?

I think I might have done something wrong, but I can't see where.

Nothing inverses now. Those values go up to a multiplication on the X and Y axes.

1.PNG2.PNG3.PNG

Sorry again for my inexperience!

Team 5411

0 Kudos
Message 4 of 11
(322 Views)
Solution
Accepted by topic author JacksonS.
02-11-2019 03:05 PM

Re: Labview (Coding Help) One button inverses/un-inverses controls?

your false case should look like this.

 

feed back fix.png

When the button is not pressed you want to keep the previous value.

Champion CLA Instructor

Making senseless computers do
intelligent real world things
is NOT easy. SO MAKE IT FUN!
Message 5 of 11
(294 Views)

Re: Labview (Coding Help) One button inverses/un-inverses controls?

Thanks! This works!

The only thing is that it starts immobile, you have to hit Y to begin the process. We can deal with this though!

Thank you!

0 Kudos
Message 6 of 11
(287 Views)
Solution
Accepted by topic author JacksonS.
02-11-2019 03:09 PM

Re: Labview (Coding Help) One button inverses/un-inverses controls?

Here is a simplified version of what you are trying to do.

Simple false.pngsimple True.png

and it may fix your issue of starting at zero

Champion CLA Instructor

Making senseless computers do
intelligent real world things
is NOT easy. SO MAKE IT FUN!
Message 7 of 11
(285 Views)
Highlighted

Re: Labview (Coding Help) One button inverses/un-inverses controls?

It did, Thank you!

Would give you 5 kudos if I could!

0 Kudos
Message 8 of 11
(270 Views)

Re: Labview (Coding Help) One button inverses/un-inverses controls?

Hey, we are trying to make this for our motor outputs, and I cannot seem to find the orange node for the program. In which library can we find the node? Thank you!

0 Kudos
Message 9 of 11
(159 Views)

Re: Labview (Coding Help) One button inverses/un-inverses controls?

Had just found it, never mind.

0 Kudos
Message 10 of 11
(158 Views)