Posts Tagged ‘NXT’

NXT-G to RobotC

August 21, 2010 2 comments

Can RobotC do everything NXT-G can?

I’ve decided to put RobotC to the test by “translating” every program you can find in NXT-G to RobotC.

I’ve built, programmed and tested every robot using the two programming languages. You can download the RobotC programs here (.7z) or here (.zip).

I think this could help new RobotC users since it shows them how to put a simple code together. That is why I used several different programming techniques while translating. (use of synchronising motors, switches etc.)

I have put several comments to help newbies understand how the program works.

While doing this, I had encountered several problems that might be of interest to RobotC developers:

– nMotorEncoderTarget isn’t very precise while running at hight speed (other methods such as the while(nMotorEncoder < Target) cause the same issues).

– When you stop a motor, it takes a lot of time to stop while running at hight speed.

– The timers aren’t very precise (try and test the RobogatorJaw.c program with both powers at 75).

All this shows us many things, such as:

-RobotC can indeed do what NXT-G can.

-RobotC is less precise than NXT-G but RobotC developers are still working on RobotC for constant improvement.

If you want more NXT software comparisions, you might want to see this.



August 15, 2010 1 comment

This is our first project using the NXTcam v3 from

The aim of this bot is to find and shoot down three red targets. It’s programmed with RobotC.

The design is the Multi-Bot by Dave Parker from (except for the NXTcam module and the LEGO Color Sensor). It can be built using a single NXT 2.0 set plus the NXTcam v3.

Here are some pictures and a video of the robot:

The robot searches and detects red targets made out of LEGOs, it then moves into position as follows:

– It aims at the center of the target

– It moves forward or backward until the height of the target is right.

If the robot hits anything with the two bumpers, it will move out of the way. The robot will turn on a different LED on the Color Sensor depending on the situation:

-Green while searching.

-Blue while aiming.

-Red while firing (blinking at first).

You can download the source files here.

All comments are welcome and if you wish to contact me, you can send me an e-mail at