Difference between revisions of "Lua development"
From ArmadeusWiki
m (→Installation) |
m |
||
(4 intermediate revisions by one other user not shown) | |||
Line 18: | Line 18: | ||
<source lang="lua"> | <source lang="lua"> | ||
− | print "Hello from | + | print "Hello from APF ! Today it's:" |
print(os.date()) | print(os.date()) | ||
</source> | </source> | ||
Line 30: | Line 30: | ||
* Copy your ''example.lua'' script to your APF9328 board through your NFS export directory or your MMC/SD | * Copy your ''example.lua'' script to your APF9328 board through your NFS export directory or your MMC/SD | ||
* then on your APF console, launch it: | * then on your APF console, launch it: | ||
+ | <pre class=apf> | ||
# lua example.lua | # lua example.lua | ||
− | Hello from | + | Hello from APF ! Today it's: |
Thu Jun 6 21:57:17 2007 | Thu Jun 6 21:57:17 2007 | ||
# | # | ||
− | + | </pre> | |
Now it's up to you ! ;-) | Now it's up to you ! ;-) | ||
Line 42: | Line 43: | ||
* [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] | ||
− | |||
− | |||
[[Category:Software]] | [[Category:Software]] | ||
[[Category:Programming language]] | [[Category:Programming language]] |
Latest revision as of 19:51, 1 August 2010
On this page you will learn how to create your first Lua script for your Armadeus board.
Installation
Lua interpreter is not installed in the default rootfs.
Lua version installed by Buildroot is 5.1.2.
- Launch Buildroot's menuconfig:
armadeus$ make menuconfig
- In
- choosing Lua package automatically selects readline and ncurses one
- then save your configuration and build your system:
armadeus$ make
- reflash your rootfs or copy it to your NFS directory or or on your MMC/SD.
Source code
First take your favorite editor/IDE and create the following script:
print "Hello from APF ! 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
- Copy your example.lua script to your APF9328 board through your NFS export directory or your MMC/SD
- then on your APF console, launch it:
# lua example.lua Hello from APF ! Today it's: Thu Jun 6 21:57:17 2007 #
Now it's up to you ! ;-)