13
Feb
11

Mentoring and using LabVIEW and Joystick buttons

First I want to share the FIRST in Texas blog on FIRST mentoring. I’m very dedicated to FIRST and helping kids learn about Science, Technology, and Robotics. I also have a lot of fun mentoring and blessed to be able to help.

Next, it’s drawing near the end of the robot build season and time is getting tight. I’m hoping everyone is getting close to getting done or at least has a plan on getting done. With most teams, as in real engineering, the programming is getting done last. Even though the programming is getting done last you still need to test it before you get to the events.

One thing that I’ve found very useful is a way to hit and release a button and cause an action. Then later hit and release the same button and cause the opposite action. For instance, you hit the button to close the grabber and the same button to open the same grabber. Below is one way to do it, using button 8 of the joystick to control a solenoid. All the figures below are the same while loop showing the different case structure code.

Figure 1 is the diagram for the case where the button is still pressed after the processing has happened. The case structure is true when the button is pressed and the last time through the processing the button was also pressed.

Figure 1

Figure 2 below is when the button is not pressed. The result is false and no processing is done. The button is not pressed AND the last time through the processing the button was not pressed.

Figure 2

In figure 3 below, the button has been pressed and it’s first time through the loop to do the operation. This shows the processing when button was pressed AND last time through the processing the button was not pressed. This is when the actual operation is done. The innermost case statement is where the solenoid operation is done. In this case the last operation on the solenoid was turned on and the operation had been set to true. In the inner case statement it’s set to false this time so that next time the solenoid will be set opposite it currently is.

Figure 3

The false case of the innermost case statement would be opposite of figure 3, the solenoid would be turned on and a TRUE sent out. Also, the joystick and solenoid would need to be initialized in the begin.vi.

This vi would allow the opposite operation be done each time the button is pressed. There may be easier ways to do this by the NI folks, but this is the solution I came up with. I hope this helps.

Advertisements

1 Response to “Mentoring and using LabVIEW and Joystick buttons”


  1. March 5, 2011 at 2:46 pm

    Desperate for mentor for rookie team of 9 year olds doing ideas competition.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: