Difference between revisions of "Lua development"

From ArmadeusWiki
Jump to: navigation, search
Line 28: Line 28:
  
 
==Running==
 
==Running==
* Copy your ''example.lua'' script to your APF9328 board through your NFS export directory or your MMC/SD
+
* Copiez votre script  ''example.lua''à votre carte APF9328 via votre répertoire d'export NFS ou sur votre MMC/SD
* then on your APF console, launch it:
+
* ensuite sur votre console APF, lancez-le:
 
  # lua example.lua
 
  # lua example.lua
 
  Hello from APF9328 ! Today it's:
 
  Hello from APF9328 ! Today it's:
Line 35: Line 35:
 
  #
 
  #
  
Now it's up to you ! ;-)
+
Maintenant, vous y êtes ! ;-)
  
==Links==
+
==Liens==
 
* [http://www.lua.org/ Lua Homepage]
 
* [http://www.lua.org/ Lua Homepage]
 
* [http://www.lua.org/notes/ltn002.html Optimizing Lua for embedded systems]
 
* [http://www.lua.org/notes/ltn002.html Optimizing Lua for embedded systems]
 
* [http://lua-users.org/wiki/LuaVersusPython Lua compared to Python]
 
* [http://lua-users.org/wiki/LuaVersusPython Lua compared to Python]
 
* [http://www.devmaster.net/articles/lua/lua1.php Lua scripting: basics]
 
* [http://www.devmaster.net/articles/lua/lua1.php Lua scripting: basics]
 
<br>[[Image:FrenchFlag.png]][[Fr:Développement Lua| Cette page en français]]
 

Revision as of 07:35, 2 August 2007

On this page you will learn how to create your first Lua script for your Armadeus board. Lua.png

Installation

Lua interpreter is not installed in the default rootfs. Lua version installed by Buildroot is x.x.

  • Launch Buildroot's menuconfig:
armadeus$ make menuconfig
  • In

Menuconfig package.png
choose
Menuconfig package python.png

  • choosing Lua package automatically selects readline and ncurses one
  • then save your configuration and build your system:
armadeus$ make
  • copy generated rootfs to your NFS directory or on your MMC/SD. If you already have an existing rootfs then just make a:
armadeus$ cp -r buildroot/build_arm_nofpu/root/usr/ /local/export/

Here /local/export/ is my NFS directory.

Source code

First take your favorite editor/IDE and create the following script:

print "Hello from APF9328 ! Today it's:"
print(os.date())

Save it as example.lua

Compilation

Not needed. Transforming Lua scripts in "executables" with Luac hasn't been tested yet.

Running

  • Copiez votre script example.luaà votre carte APF9328 via votre répertoire d'export NFS ou sur votre MMC/SD
  • ensuite sur votre console APF, lancez-le:
# lua example.lua
Hello from APF9328 ! Today it's:
Thu Jun  6 21:57:17 2007
#

Maintenant, vous y êtes ! ;-)

Liens