FIRST Tech Challenge Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Button control on prototype robot (Archived)

Update: This discussion applies to Issues from the 2010 FTC season and is no longer relevant for current FTC competition software.


Hi everyone,

While the mechanical and electrical teams are working on the rest of the robot, the programmers are working on configuring all of the controls using an NXT robot with LEGO motors to simulate the tetrix motors on our final design. We have joystick control of the lego robot drive motors (A and C), but our attempts to make a LEGO motor on port B move only when a button is pressed hasn't been successful. The image of the program shows what we believe should work, but instead motor B spins continuously.

Do we need to sequence/connect the NXT ports between the VIs? The Display Text VI I threw in is showing that it is reading the buttons on the controller, but the motor power is not changing.

Any assistance would be appreciated - thanks!

Evan

Download All
0 Kudos
Message 1 of 4
(4,645 Views)

Hi Evan,

The download for your code isn't up yet, but I'm curious to see what the False case in the case structure is.  If you depress the button and there's not any code in the False case, nothing happens and the motor continues to run.  You'll probably want to stop the motors in the false case.

Kyle S

FIRST Applications Engineer

0 Kudos
Message 2 of 4
(3,356 Views)

I'm not sure if you can access the labview file, but it seems to be posted now. I'm attaching a view of the false case to this post.

Let me know if this helps - thansk!

0 Kudos
Message 3 of 4
(3,356 Views)

Hi Evan,

I think you needed to swap the cases from checking whether or not you had a valid packet.  I also removed the code in your case that stops all the motors because it skipped the motors when I pressed the button.  After those changes, it was working ok.  I attached your modified code.

I also recommend using the Teleop Basic template found in [LabVIEW]\examples\FTC\templates.  It handles the packets from the controller station for you and you only need to modify the bottom loop for your teleop code.  I created the same example from the template and attached it below; I didn't have any trouble with it.

Good luck!

Kyle S

FIRST Applications Engineer

0 Kudos
Message 4 of 4
(3,356 Views)