Elementerials Posted January 18, 2013 Posted January 18, 2013 I'm not very tech savvy so bear with me. I've bought a lego NXT 2.0 recently and my current goal is to build a working sentry turret. I want to be able to manually remote control the motors from my laptop with Bluetooth, however the remote control function in the NXT program seems limited as it only works on creations whose movement are controlled by two motors working in tandem. Similar to a robotic arm, or a car where 1 motor controls movement and the other controls steering, ideally my turret should have one motor control vertical movement and the other controlling horizontal movement, so that when i press the Up and Down arrows, it only steers 1 motor, and vice versa with the left and right arrows. My question is whether or not it's possible to reconfigure the remote control function to work that way? Also, is it possible for the "Action" button on the remote control function to be reconfigured? rather than controlling the third motor's movement directly by holding down the spacebar, is it possible to set it to perform a string of actions? (play a sound, rotate 10 times) Lastly, I've been trying to create a program for it to behave like an automatic turret by infinitely panning left and right horizontally until the ultrasonic sensor detects objects, stopping the loop immedeately, targeting the object and locking on to it, activating the third motor, and, when done, going back to its default vertical position and playing the horizontal panning loop again. One of the main problems I encountered is that I cannot interrupt motor movement with a "Stop" block activated by the Ultrasonic sensor. It's harder than I thought and by now I fear that trying to create a "targeting" program would go beyond my understanding of the NXT program. So i'm wondering if anyone experienced with this set could help me create such a program or explain to me how it works. I've seen videos of people on youtube doing just that, so I know it's possible. Any help is appreciated. Quote
kieran Posted January 18, 2013 Posted January 18, 2013 Hi, I am not sure how far you can go with the default Lego programming environment. I use NXT which is free and includes a remote that can move the three motors independently or you would code one in windows OSX if you know how to program? As far as scanning with the sensor goes this is very possible, you need to write a loop that repeats until the sensor value reaches some point, in NXC I would use 2 parallel tasks, one would take care of the left / right movement and the other monitoring the US sensor, then the sensors picks up a target it would set a variable that the other movement task is checking in the main movement loop, this will then stop the main movement and hand control of the motor to the targeting task, once this has completed it sets the variable back and the main left right task takes back control and continues until the program ends. Quote
Jim Posted January 18, 2013 Posted January 18, 2013 (edited) Hi Elementerials, Welcome to EB!! I am not really sure about the NXT remote. My best guess is, that you can set it to some independent mode, but I have to look into this. Furthermore, I would recommend writing your own program with the NXT-G software. With NXT-G everything you mentioned is possible and then some Since you are not savvy, you might want to pick up a book, like: "The Art of Lego Mindstorms NXT-G Programming" This is a great book to get acquaintant with the programming environment. Step by step you should try to improve your model. If you have an iPad or eReader, there's a Kindle version of the book: http://www.amazon.com/LEGO-MINDSTORMS-NXT-G-Programming-ebook/dp/B004AE3P4A/ref=tmm_kin_title_0?ie=UTF8&qid=1358503776&sr=8-1 Edited January 18, 2013 by Gekke Ted Quote
Elementerials Posted January 18, 2013 Author Posted January 18, 2013 Hi, I am not sure how far you can go with the default Lego programming environment. I use NXT which is free and includes a remote that can move the three motors independently or you would code one in windows OSX if you know how to program? As far as scanning with the sensor goes this is very possible, you need to write a loop that repeats until the sensor value reaches some point, in NXC I would use 2 parallel tasks, one would take care of the left / right movement and the other monitoring the US sensor, then the sensors picks up a target it would set a variable that the other movement task is checking in the main movement loop, this will then stop the main movement and hand control of the motor to the targeting task, once this has completed it sets the variable back and the main left right task takes back control and continues until the program ends. I don't know how to program, sadly. This is something like what i've tried. the problem is that I cannot get the Sensor detection to interrupt the other task and immediately switch to the parallel task, instead it waits until the entire loop is over. I also have trouble getting the loop back on track after detecting a target. Also I've found that targeting isn't as easy as it sounds (as in trying to keep the motors to lock the sensor on to the detected object.) Where can I get the program you use? Hi Elementerials, Welcome to EB!! I am not really sure about the NXT remote. My best guess is, that you can set it to some independent mode, but I have to look into this. Furthermore, I would recommend writing your own program with the NXT-G software. With NXT-G everything you mentioned is possible and then some Since you are not savvy, you might want to pick up a book, like: "The Art of Lego Mindstorms NXT-G Programming" This is a great book to get acquaintant with the programming environment. Step by step you should try to improve your model. If you have an iPad or eReader, there's a Kindle version of the book: http://www.amazon.co...58503776&sr=8-1 I will do that, sounds like that would really help. Thanks for the advice! Quote
kieran Posted January 18, 2013 Posted January 18, 2013 If you want to look at Nxc just google search Nxc or bricxcc and you will find all the info Quote
Jim Posted January 18, 2013 Posted January 18, 2013 Another option would be to search for other third party remote apps. I know there are quite a few, some better than others. Even some on iPhone and iPad, although they need some software installed on your computer (which is not a problem). You might also find this article interesting: http://www.nxtprograms.com/extra/PF_remote/index.html Are you using Mac or Windows? http://www.macupdate.com/app/mac/32602/lego-nxt-remote If you are using and Android phone you can connect directly to the NXT. There will probably be lots of apps, like: https://play.google.com/store/apps/details?id=org.jfedor.nxtremotecontrol&hl=en But if you want to have the brick work on itself, I would put my eggs in the NXT-G basket. It's pretty easy to use when you get the hang of it. Quote
Elementerials Posted January 18, 2013 Author Posted January 18, 2013 Another option would be to search for other third party remote apps. I know there are quite a few, some better than others. Even some on iPhone and iPad, although they need some software installed on your computer (which is not a problem). You might also find this article interesting: http://www.nxtprogra...mote/index.html Are you using Mac or Windows? http://www.macupdate...lego-nxt-remote If you are using and Android phone you can connect directly to the NXT. There will probably be lots of apps, like: https://play.google....tecontrol&hl=en But if you want to have the brick work on itself, I would put my eggs in the NXT-G basket. It's pretty easy to use when you get the hang of it. The Lego NXT remote program looks very nice, and just like what I need, however I only use pc. I don't have a smartphone either so remote controlling from my PC is my only option. I'll look into finding that book so I can learn how to use NXT-G better. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.