We’re rewarding the question askers & reputations are being recalculated! Read more.
23

The programming interface used by LEGO creates programs which make use of the standard firmware, that is, the one provided by LEGO. If you look at alternatives (see also this answer for more information), you'll notice that quite a lot of them use the same firmware. This means that the programs they produce use the same language which is interpreted by the ...


12

There are alternate text-based programming languages for the NXT. Three of the most popular ones are NXC/NBC, LeJOS NXJ, and RobotC. There are many more, all with their pros and cons, and are much more versatile than NXT-G, even on slow computers. I my personal favorite is NXC/NBC. But really it's up to you. The best way to see what suits your needs is to ...


11

I was looking into this just recently. There are libraries and also it seems there are other firmwares offering alternative operating systems you can embed on the Mindstorm. For C++ you could try: nxtOSEK is an alternative OS offering a C++ api BrickOS is an alternative OS with a C/C++ development environment NXT++ is a C++ lib for controlling the original ...


10

Yes, this is definitely possible! You can connect up to 7 different NXT devices from one computer and one Bluetooth dongle (theoretical limit). I have tested this with the RWTH - Mindstorms NXT Toolbox for MATLAB) successfully with 5 NXTs on Linux and with at least 2 NXTs on Windows. In real life, it depends on your Bluetooth hardware. Your Bluetooth stack ...


8

If you wish to program the EV3 with Scratch, then check out this project on github: https://github.com/koen-dejonghe/ev3-scratch-helper-app This software is a so-called helper app, that interfaces between the Scratch 2.0 offline editor and the Lego Mindstorms EV3. The EV3 must be booted from Lejos (http://sourceforge.net/p/lejos/wiki/Home/), requires a ...


8

No, but you can use a very similar programming language: Enchanting. (I haven't tried it yet. It was recommended by the programming instructor).


8

Yes, it is possible to pass the port number as a parameter to a sensor or motor block via data wire. It's just that it's manually selected by default. To change this, go to the port of the sensor or motor block, and select the top-most option which has the plug icon on it: It will then create a data port for which motor port you want to use: The same ...


7

Please help make this post better! This needs: Clean up Removal of irrelevant information plagiarized from copied off Wikipedia Links [Possibly] Pictures or Code samples NXT-G Graphical programming environment Uses Blocks Based on LabView Parallel "sequence beams" are actually parallel threads Comes bundled with the NXT The language ...


7

I think that all you might need is the Microsoft Robotics Developer Studio. The examples that I could find all refer to C#, VB.Net, or the included VPL languages but there isn't any reason you wouldn't be able to reference the same objects from managed C++. It does look like there might not be a full set of services for all of the more recent parts judging ...


7

You can't calibrate the motors, neither mechanically or in software. There is however several methods in the software to account for this. The standard NXT firmware contains a synchronization mode which attempt to keep the two motors aligned. In NXC you can do this by using the function OnFwdSync like this: OnFwdSync( OUT_AC, 75, 0 ); First parameter is the ...


7

I could not find this in the help file, but according to this thread "Another little known characteristic of MyBlocks is that they aren't re-entrant. No two copies of the same MyBlock can be running at the same time." I tried a few simple programs in EV3-G and confirmed that this is true. The order in which they run appears to be random.


7

LEGO calls this communication protocol the "LEGO Wireless Protocol" (LWP). The documentation is publicly available at https://lego.github.io/lego-ble-wireless-protocol-docs/. There is also a GitHub repository that provides the source of this website at https://github.com/LEGO/lego-ble-wireless-protocol-docs. Because of this, it seems reasonable to expect ...


6

The difference in speed can't be avoided. Even if the motors themselves were carefully paired, differences of friction on the axles or weight unbalance of the robot would result in speed mismatch. I am not used to LabVIEW, but the NXT firmware has a way to synchronize two motors, this functionnality should be available in LabVIEW.


6

After looking around a bit in the NXT IO palette in LabVIEW, I found a few functions which will sync the motors while driving the robot. The "drive distance" and "steering on" VIs will both sync the motors appropriately to make the robot drive straight. The "motor on" and "motor reverse" blocks, which are the default options if you don't go down into the ...


6

It turns out that the issue is a faulty/weak motor connector socket. While randomly trying to troubleshoot, I found that if I did nothing more than press or move the cable, the motor would act bizarrely. Initially I thought it was a bad cable, but after trying additional cables it seems that it is more likely just a poor connection at the motor. I suppose ...


6

Your code handling the behaviours like "Shoot 3 times if the touch sensor is triggered" or "Shoot if the light sensor is triggered" should use 'if' statements. Then, instead of always being called, the "shooting" code would append only on sensor events. After shooting, the robot would then go back to the "Driving around" part of the code. This page is a ...


6

It is possible now (since version 1.3.0) by pressing the button at the upper left corner of the block:


6

One way of doing this is using a loop and interrupting it. How it works: The "Loop Interrupt" block stops all blocks running inside of the loop, so by interrupting the loop after either wait block, it will stop the other wait block. The type of loop doesn't actually matter because we never reach that point. I chose to wait for "Logic" with a value of "...


6

I think it would be more realistic to have the robot drive in a straight line but have a linkage to the foci of the ellipse that "pulls" the robot towards the center of the ellipse just as orbiting objects are pulled toward Earth by gravity. For example, you could use two nails in a board as the foci. Tie a string in a loop to use as the linkage. Place the ...


6

A sensor port can't directly output to a motor. The sensor drivers can't provide enough power to supply a motor. You have a couple options: Daisy-chain two EV3s together. The first can control the sensors and motors of the second. Use an electronic motor multiplexer. EDIT: It should be noted that this requires an external power supply, which will increase ...


5

From the page you linked to we can see that the NXC OnFwd method has the following parameters: void OnFwd (byte outputs, char pwr) The power or speed parameter is listed as a char type, and looking around elsewhere on the site we find the definition of the char to be: In NXC the char type is a signed 8-bit value. This type can store values from ...


5

Mitch Resnick at the MIT Media Lab is the developer of both Scratch and the original Mindstorms programmable brick, and the original Mindstorms programming interface was very similar to Scratch. If you have one of the original Mindstorms Robotics Invention System sets (and a PC of the proper vintage on which to run the software) she would probably find it ...


5

You can program the raw hardware: The main microcontroller in the NXT is an Atmel AT91SAM7S256 (data sheet), which uses the ARM7TDMI core from ARM. This core is supported by gcc, so you can use GNU tools to program it in Assembly/C/C++. You can build a firmware for the AT91SAM7S256 and load it via USB, after putting the controller in SAM-BA mode by a long ...


5

No, the standard NXT-G software provided by LEGO will not allow you to program a RCX brick. Outside of official software, your best bet is probably to use NQC which is C-like; there's also NXC for the NXT which is similar. There are a lot of others which have been discussed in the following questions: Is there any other way to program the Lego Mindstorms ...


5

The problem can be restated: 360 / 20 = 18 deg / sec = 1 deg / .056 sec One degree is the smallest increment provided by the rotation sensors. NXT-G has a timer sensor with 1/100th second resolution. In pseudo-code: Set a motorPower variable to 10 Start a timer Loop until rotationDegrees >= 360 If timeElapsed * 18 > rotationSensorDegrees ...


5

As was pointed out, this question is not specific in nature, so it's hard to give a definitive answer. If you haven't already done so, it would probably be helpful head over to Lego.com and grab get the NXT 2.0 User Guide and perhaps begin looking through the sample programs. This book may also be helpful to you: The LEGO MINDSTORMS NXT 2.0 Discovery Book: ...


5

The ultrasonic cannot detect the color of objects. It's just to detect the distance between the sensor and an object in it's line of sight. To find objects in the surrounding area of your robot you have to look all around. This is simply done by rotating your robot or your sensor. When you measure a distance in a certain range (best results between aprox. ...


5

This can usually be achieved on the EV3 with a bootable SD card - you would set that up with a new firmware image and a loader that copies it across to the brick. The leJOS team have ported their codebase to the EV3 - so with a bootable SD card you can indeed load a modified version of the firmware onto your EV3 brick. You can then use their WiFi stack to ...


5

I know that this question is old, but if someone else has this question, I have found that these error messages often appear when you are either trying to access a non existent array (i.e. you copied the block from another project and you did not change the name of the variable) OR when trying to access a value of an array with an index that does not exist (...


5

There is a (new?) LEGO brand sound sensor (9845) for $35 on the LEGO store. I don't know if it's suitable for your particular application but sounds plausible. Using the NXT Brick (sold separately), the Sound Sensor allows your LEGO® MINDSTORMS® NXT robot to hear! The Sound Sensor is able to measure noise levels in both dB (decibels) and dBA (frequencies ...


Only top voted, non community-wiki answers of a minimum length are eligible