EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Using Lua on LPC with Crossworks

Started by Jakub Szumacher September 7, 2011
I need to use Lua in my C project.

1. Load Lua script from file
2. Execute it

I found many informations about Lua but still dont know how to do this
on microcontroller.

Im looking for simply example:

Execute Lua line: print("hello world")

in C program in Crossworks.

Regards
Jakub

An Engineer's Guide to the LPC2100 Series

eLua?

There is an eLua port to SolderCore if you go looking for it, based on GCC, so moving that into CrossWorks should not be too hard.

http://wiki.eluaproject.net/SolderCore

-- Paul.

On 7 Sep 2011, at 08:30, Jakub Szumacher wrote:

> I need to use Lua in my C project.
>
> 1. Load Lua script from file
> 2. Execute it
>
> I found many informations about Lua but still dont know how to do this
> on microcontroller.
>
> Im looking for simply example:
>
> Execute Lua line: print("hello world")
>
> in C program in Crossworks.
>
> Regards
> Jakub
>
>
You can find lua ported to Espardino (LPC2148) here:

http://code.google.com/p/espardino/source/browse/#svn%2Ftrunk%2Fopenlibs%2Flua

and one example here:

http://code.google.com/p/espardino/source/browse/trunk/examples/C/micro2148_lua/main.c

good luck! ;)

Miguel Angel Ajo Pelayo
http://www.nbee.es
+34 636 52 25 69
skype: ajoajoajo
2011/9/7 Paul Curtis

> **
> eLua?
>
> There is an eLua port to SolderCore if you go looking for it, based on GCC,
> so moving that into CrossWorks should not be too hard.
>
> http://wiki.eluaproject.net/SolderCore
>
> -- Paul.
> On 7 Sep 2011, at 08:30, Jakub Szumacher wrote:
>
> > I need to use Lua in my C project.
> >
> > 1. Load Lua script from file
> > 2. Execute it
> >
> > I found many informations about Lua but still dont know how to do this
> > on microcontroller.
> >
> > Im looking for simply example:
> >
> > Execute Lua line: print("hello world")
> >
> > in C program in Crossworks.
> >
> >
> >
> > Regards
> > Jakub
> >
> >
> >
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
>
I would suggest using eLua.  http://www.eluaproject.net/

________________________________
From: Jakub Szumacher
To: l...
Sent: Wednesday, September 7, 2011 2:30 AM
Subject: [lpc2000] Using Lua on LPC with Crossworks
 
I need to use Lua in my C project.

1. Load Lua script from file
2. Execute it

I found many informations about Lua but still dont know how to do this
on microcontroller.

Im looking for simply example:

Execute Lua line: print("hello world")

in C program in Crossworks.

Regards
Jakub
I saw it but it is very complicated (huge) project.

First of all I need simply "Hello world" on my LPCxxxx, not using ADC,
serial etc.
> I would suggest using eLua. http://www.eluaproject.net/
At 04:38 AM 9/8/2011, you wrote:
>I saw it but it is very complicated (huge) project.
>
>First of all I need simply "Hello world" on my
>LPCxxxx, not using ADC, serial etc.
>>br /> >>I would suggest using
>>eLua. http://www.eluaproject.net/
>

I believe that your original post asked about
running Lua statement inside your C program, Lua
is a programming language and as such it's not a
trivial program, the device libraries are a small part of Lua.

If all you want to do is to print something on a
display then you can do it in C and not get Lua
involved at all but if you want the full range of
Lua commands then you have no choice but to put
that "huge project" in or something similar.
Cecil
k5nwa
< www.softrockradio.org > < http://thepartsplace.k5nwa.com/ >
< http://parts.softrockradio.org/ >

Never take life seriously. Nobody gets out alive anyway.
Mate, "flash it into your board, connect a serial terminal (or Ethernet if
you board supports it) and enjoy *eLua*."
http://prdownload.berlios.de/elua/elua0.8_lua_lpc2468.hex

But if you really need to do custom C code stuff, you'd better learn how it
works.
http://www.eluaproject.net/get-started/downloads

2011/9/8 cbayona

> **
> At 04:38 AM 9/8/2011, you wrote:
> I saw it but it is very complicated (huge) project.
>
> First of all I need simply "Hello world" on my LPCxxxx, not using ADC,
> serial etc.
> br /> > I would suggest using eLua. http://www.eluaproject.net/
>
> I believe that your original post asked about running Lua statement inside
> your C program, Lua is a programming language and as such it's not a trivial
> program, the device libraries are a small part of Lua.
>
> If all you want to do is to print something on a display then you can do it
> in C and not get Lua involved at all but if you want the full range of Lua
> commands then you have no choice but to put that "huge project" in or
> something similar.
>
> **
>
> ** Cecil
> k5nwa
> < www.softrockradio.org > <
> http://thepartsplace.k5nwa.com/ >
> < http://parts.softrockradio.org/ > Never take life seriously. Nobody gets out alive anyway.
>

The 2024 Embedded Online Conference