1

I have a basic LEGO Mindstorms kit which I wanted to use for testing a very simple object-avoidance project.

I am trying to find a relatively simple way to flash the brick and upload scripts to it for executing, preferably something simple like Python or C++. I've been looking around the Internet for a few weeks now and have found almost nothing.

I see some instructions how to flash the brick with some generic firmware, but no more information how to get to the point of programming it the way I need. I see the most popular source for programming the NXT in Python is NXT-Python. However, there is 1) no documentation 2) outstanding bugs on the ultrasonic sensor that has not been addressed since 2015 and 3) only executes the program on the PC and sends command to the brick, rather than uploading the program to the brick.

I see that NXT is usually programmed in the language NXC, which fortunately has an extensive documentation in PDF form. However, this language (based in C) seems like an entire beast of its own, and idk if I would have the time or patience to master an entirely new language just to program for this one small project. Furthermore, the GUI for NXC seems to be only for windows, but I'm using Ubuntu.

NXC seems to be translatable from Python using the PyNXC library. However, it also doesn't seem to have any documentation except a couple of examples, and otherwise just pointing to the NXC tutorials.

Anything I am missing here, or is that the entire length and breadth of programming the NXT? I have a feeling there has got to be something more straight forward, as other people online talk about programming the NXT in python as if it was easy.

Thanks

8
  • Have you checked out the answers to this question and this detailed page? I think the fundamental issue is the Python limitation. RobotC has three different flavours ranging from Graphical, through Natural Language down to a more C-like version Apr 26, 2018 at 8:30
  • The limitation is not really Python, but just some existing, usable language. I did see that chart before, and my issue with it is that the only languages it mentions are Assembly, C, and Java. I could try to install the Java version, I guess, because I don't see myself getting very far programming in either Assembly or C. Even so, Java is not exactly the kind of language meant to be used for a Robot, so idk why I should be forced to use that. As for the rest, I don't want to have to work with a completely new language from scratch, even if it is "C-like".
    – Nathan
    Apr 26, 2018 at 14:55
  • I can program a Raspberry Pi in any language I want. How much more complicated can a piece of LEGO be?
    – Nathan
    Apr 26, 2018 at 15:00
  • 1
    The NXT has a 32bit, 60MHz ARM processor, 256KB of FLASH memory and 64KB of RAM. The PI Zero has a 1GHz processor, 512MB RAM, while the PI 3 B+ has a 64bit, 1.4GHz processor, 1GB RAM, etc. Apr 26, 2018 at 15:22
  • 2
    LEGO MINDSTORMS EV3 runs Linux and can be programmed in Python using ev3dev. Perhaps you have been hearing about EV3 instead of NXT? Apr 26, 2018 at 16:13

2 Answers 2

2

I've had great success with Bricx Command Center or BricxCC (as mentioned in this post) on my NXT using NXC (which is easy to pick-up when you already have a C/C++ foundation like you've mentioned).

Installation, using the supplied drivers and connecting via USB is a breeze :)

Hope this helps!

1

In my experience, most 3rd-party firmware can be flashed to the NXT brick using the standard NXT-G software "Firmware Update Tool." As others have mentioned, BricxCC with NXC is also a great option. And if you're having trouble with the Python implementation, it's definitely worth checking out LeJOS (Java for Mindstorms). While Java may not be the usual choice for robotics, LeJOS runs fast and is easily the most feature-rich of any language available for the NXT.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.