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 / 52
51  |  53
Subject: 
Re: NXT Programming with C Question
Newsgroups: 
lugnet.robotics.nxt.nxthacking
Date: 
Sat, 19 May 2007 14:32:55 GMT
Viewed: 
15614 times
  
In lugnet.robotics.nxt.nxthacking, Ralph Hempel wrote:
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

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.



Message is in Reply To:
  Re: NXT Programming with C Question
 
(...) 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 (...) (17 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
    

Custom Search

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