To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.nxt.nxthackingOpen lugnet.robotics.nxt.nxthacking in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / NXT / NXT Firmware Hacking / 50
49  |  51
Subject: 
Re: NXT Programming with C Question
Newsgroups: 
lugnet.robotics.nxt.nxthacking
Date: 
Sat, 19 May 2007 13:47:26 GMT
Viewed: 
16227 times
  
Alexis Morris wrote:
Hi there:

I've been trying to find a method of coding the NXT using C, however the
existing languages available, such as RobotC, or NBC/NXC etc all seem to be
C-like languages and not ANSI C.

This seems to be the trend, but does anyone know why plain C code can't just
compile and run on the NXT (using the appropriate ARM cross-compiler)?

Additionally, the C-ish NXT programming options are using the VM approach,
although I can't say whether it's because it's too difficult to use ANSI or not.

There's no reason you can't compile straight ANSI C and run it on
the NXT. I was doing it last year and ran an ATMEL sample program that
turned the NXT into the world's most expensive 256K (not M) Flash
drive :-)

The hard part is using the LEGO code, linking into your application, and
having your bot do something useful - and then debugging it when
something goes wrong. And something WILL go wrong.

What the VM approaches let you do is keep a fairly well-known and
tested chunk of code in FLASH and then put your robot behaviour into
RAM.

Any of the alternative programming languages will let you do
this. If you're stuck on C, then Robot C is probably the best bet
since it has a custom VM that runs much faster than the standard
one from LEGO.

If you want to actually compile and run code on the brick, then my
pbLua firmware might be a good choice.

Cheers, Ralph



Message has 1 Reply:
  Re: NXT Programming with C Question
 
(...) Hi Thanks for the fast response, I think I'll have a look at the pbLua firmware. What I am working towards is a method of running Haskell programs on the NXT by converting to C bytecodes first. (18 years ago, 19-May-07, to lugnet.robotics.nxt.nxthacking)

Message is in Reply To:
  NXT Programming with C Question
 
Hi there: I've been trying to find a method of coding the NXT using C, however the existing languages available, such as RobotC, or NBC/NXC etc all seem to be C-like languages and not ANSI C. This seems to be the trend, but does anyone know why (...) (18 years ago, 19-May-07, to lugnet.robotics.nxt.nxthacking)

6 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR