Robot App Store Developer Program


Knowledge Base

How To Program Lego NXT- Introduction

  By Anna Sandler

There are several ways to program Lego NXT:
  • Using the LEGO Mindstorms NXT official software- This software is free and comes with LEGO NXT package.
    It has a powerful UI programing side, and it is basically a Drug & Drop programming.
    This kind of programming is very simply and can be adopted even by a non-programmers or children.
    It is great for learning the basics of programming and basically covers everything you need for your project.
    Be careful- Lego has a very restrict license agreement for this software.
    You cannot make a commercial usage for projects that have been developed by this software.
  • Using third-party software’s- There are a lot of free and non-free wrappers for Lego communication protocol and firmware.
  • Using a Lego NXT communication protocol (LCP)-It is completely free, and you can make money out of your project
    but first, we must warn you this is a low-level programming.
    It’s a wild dangerous journey that is not meant for faint hearted and pregnant women :).
    This protocol will be fully covered in the next tutorials.
    It will open a whole world of possibilities and new amazing projects that can be built with Lego NXT.

How to program Lego over Bluetooth

LEGO NXT can get commands through Bluetooth (supporting the Serial Port Profile as well) or USB communication.
This communication protocol is called NXT direct commands or Lego NXT communication protocol (LCP).
NXT communication protocol bypasses the Mindstorms (LEGO official software) or any other third-party software.
This protocol is used for controlling NXT from a remote device (smartphone, PC, other robots…).

Sending commands to Lego NXT through Bluetooth is rather simple-
the idea is to transfer a bulk of bytes to the robot for immediately execution.

The commands are divided into two groups:
  • System commands- Administrative commands that control the administration of the brick or the protocol.
    Example for administrative commands can be- access the file system on the brick or communication configuration;
  • Direct commands- Commands that control robot's motion, sensor's reading…
Some of the commands are a request for feedback from the robot (get sensor's data…),
while other commands are just a set for orders.

Programming languages

Low level programming refers to programming using bytes.
Whether you are a .NET, Java, Python, C++ or a C programmer (or any other language), it is all supported.

If you just want to play with the command bytes before you dive into the code,
we recommend the RealTerm freeware terminal.

What's next?

So take a deep breath and let’s build something amazing!
A kind of robot-app that will make people to buy a robot just to get this app! Let’s see what is actually sent to the NXT’s brick as a command.

click wives that cheat married men having affairs
all about abortion side effects of the abortion pill misoprostol and abortion

Related Robot-Apps™