NXT: Which C dialect should I pick?

Sep 08, 2009 5 Replies

Hi,



I'm looking to writing software for the NXT in either pure C or a dialect thereof. I had the option of choosing the Java Optimized Processor (JOP) instead of the NXT, but I wanted to seek a different challenge so I chose C/C dialect.



Searching the net, I find that most options for writing for the NXT is in C dialects and not pure C. I had hoped to get a chance to use pointers etc., but it seems like you're pretty sandboxed with most of the options out there.



Also, is it possible to measure execution of selected tasks on the NXT once it's compiled for it?



Regards, Anders


Can you elaborate on this? What do you mean by "in C dialects and not pure C"?

As far as I know the NXT has two processors, an AVR and an Atmel ARM7 - both of which have both free and commercial C compilers available. A very quick peek into the source code download from the Lego site would lead me to believe they are providing C code for you.

Regards, Richard. + http://www.FreeRTOS.org Designed for Microcontrollers. More than 7000 downloads per month. + http://www.SafeRTOS.com Certified by TÜV as meeting the requirements for safety related systems

pure

By C dialects I mean RobotC and NXC (Not eXactly C) e.g. By pure C I mean ANSI C.

oth

uick

Thank you kindly. I will look into that.

Regards, Anders

Perhaps we should change it to "use pointers etc _by hand_".

I'm struggling to think of a programming language which does not make heavy use of pointers in its ultimate execution... there probably is one somewhere, but most rely on them for practical implementation. The difference is that the user is often not permitted to access them by hand. By they are still present, and still cause issues... consider all those "null pointer exceptions" you can generate in a "pointer free" language like java, when you try to call methods of non- existent objects...

While we can debate the merits of manually using pointers in everyday programming, I'd be very suspicious of a programmer who had no "educational" experience of doing so in their background.

Sorry, I should not have said pointers cause such issues in more abstract languages, but that they are often associated with the symptoms of problems.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required