FIRST Tech Challenge Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

NXT motor not responding to buttons programmed to

Solved!
Go to solution

When we assign an NXT motor to port A and on Remote one use turn while pressed in one direction for button 7 and turn in the other direction for button 8 we have no problem in test. When we generate code, the motor either comes out in the vi as a tetrix motor or as an NXT motor in Port C. I tried just moving the cable to Port C, but not only did it not get a response it created alerts in the Remote Config window. We have some LabVIEW experience from FRC, so we went to the vi and tried to assign the motor we linked back to the schematic with configure and saved and generated, but it still did not work. Any ideas?

Thanks

0 Kudos
Message 1 of 13
(7,434 Views)

the code gennerated by lvlm will consider nxt motor as a dc motor, so you need to change it mannually in the program.

just replace the dc motor and break with the nxt motor block and the ports.

0 Kudos
Message 2 of 13
(5,250 Views)

Thanks so much. I am glad to know I am on the right track. I have tried to do as suggested, but where in the palletes the the "NXT" motors exist? Or do I need to download a special vi? Also our button case for the 2nd controller shoes "lego Motor" as the item of the VI, but it is not clear in that area ow I designate the ports. The robot does run correctly when we test it in the remote configuration portion. I have attached a doc with a scren shot of the code we are seeing. Thanks so much. https://docs.google.com/a/lakefentonschools.org/document/d/1kxljJ4SknIIPJVIh45WmXtzekh3SyuHjtAnvtywW...

0 Kudos
Message 3 of 13
(5,250 Views)

Functions Pallet (right click), NXT I/O, Motor - is the Lego Motor vi

0 Kudos
Message 4 of 13
(5,250 Views)

Thanks, at least I am no longer worring that I have the wrong motor. But I still cannot make the Lego motor plugged directly into A on the block respond to any button. Getting desperate.

0 Kudos
Message 5 of 13
(5,250 Views)

Post a screen shot of the part of the code that addresses this motor. Maybe it will be obvious if I can see it.

You say the motor works in test, so it doesn't sound like a hardware issue.

Some ot the software bugs are being resolved by ensuring your vi is an 'NXT target', saving, exiting, and restarting LV.

Message 6 of 13
(5,250 Views)

Thanks for the screen shot. It's quite clear that Controller 1, Button 7 is still referencing a DC Motor. Don't be fooled by the software giving you the option of choosing a Lego Motor in this case (seems to be a bug).

The 'generate code' function is making some errors, and you have one here.

As Jerry said earlier you will want to replace that DC Motor block with the Lego Motor block found at the 'Functions Palette, NXT I/O, Motor' (alternative: rt click on the DC Motor block and choose Replace, All Palettes, NXT I/O, Motor) - This is the Lego Motor vi and the picture on it will look like a little LEGO motor (grey and orange).

You will then proceed to rt-click on each of the nodes of that block to 'create constants' that define what you are after. (ie. rewire it)

See the attached file below for a screen shot of a wired Lego Motor block.

You might like to try the ctl-H option of having the help files for each part of the code displayed as you explore the generated code. It's a great way for the kids to learn.

If you still need help, don't be afraid to ask.


Message 8 of 13
(5,250 Views)

We have the Lego motor running while pressed. We had to create a blank robot and build it up without the FTC Arm and Gripper template. We are not sure why, but now we can copy that teleop into any project we create and it works. Thanks for all the help.

Message 9 of 13
(5,250 Views)

There is a patch that might make the 'generate code' function work properly, and resolve this issue.

https://decibel.ni.com/content/thread/19336?tstart=0

UPDATE: no dice. I tried a new 'generate code' after installing the patch and you still need to manually replace the block.

Further update: ESearl of NI assures me that we can actuallly run an NXT motor using the DC Motor block in the new 2012 release. I never thought to try. Thx ESearl.

0 Kudos
Message 10 of 13
(5,250 Views)