|
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:
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
|
|
|
|