diff --git a/SConstruct b/SConstruct index a37dad0b..cc7517a4 100644 --- a/SConstruct +++ b/SConstruct @@ -103,7 +103,7 @@ file_list = { 'SAM7-EX256' : [ 'bisect', 'hangman' , 'led', 'piano', 'hello', 'i 'EK-LM3S8962' : [ 'bisect', 'hangman', 'lhttpd', 'pong', 'led', 'piano', 'pwmled', 'tvbgone', 'hello', 'info', 'morse', 'adcscope','adcpoll' ], 'EK-LM3S6965' : [ 'bisect', 'hangman', 'lhttpd', 'pong', 'led', 'piano', 'pwmled', 'tvbgone', 'hello', 'info', 'morse', 'adcscope','adcpoll' ], 'STR9-COMSTICK' : [ 'bisect', 'hangman', 'led', 'hello', 'info' ], - 'PC' : [ 'bisect', 'hello', 'info', 'life' ], + 'PC' : [ 'bisect', 'hello', 'info', 'life', 'hangman' ], 'LPC-H2888' : [ 'bisect', 'hangman', 'led', 'hello', 'info' ], 'MOD711' : [ 'bisect', 'hangman', 'led', 'hello', 'info', 'dualpwm' ], 'STM3210E-EVAL' : [ 'bisect', 'hello', 'info' ], diff --git a/doc/en/examples.html b/doc/en/examples.html index b11b9b3d..0b797237 100644 --- a/doc/en/examples.html +++ b/doc/en/examples.html @@ -1,127 +1,128 @@
-eLua distros come bundled with nice and fun
+(yes! we have games too! :) Lua programs examples in the File System. They are also included in the eLua
+source code distribution, under the /romfs subdirectory. As previously explained, you can run them directly from eLua's file
system or you can use the eLua shell and send them via XMODEM, as
-described here.
+described here.
Runs on:
All Targets
-
-Description:
To call this a "program" is a gross overstatement, but it's a
+
Runs on: all targets
+Description: to call this a "program" is a gross overstatement, but it's a tradition, so we respect it :) It just prints "Hello, World!" on the terminal and -returns to the shell. Download it only if you feel too lazy to fire up -the lua interpreter inside eLua and write it yourself :)
Commented Source Code:
print("Hello World")
+returns to the shell. Run it from the file system only if you feel too lazy to fire up +the lua interpreter inside eLua and write it yourself :) -Runs on:
All targets except i386
Description:
-This isn't really more advanced than "Hello, World!", but it does show
-an eLua specific module: the platform data module (pd). You can read
-more about the platform modules in the eLua source distribution
-(docs/platform_modules.txt). The program will display the platform
+
Runs on: all targets
+Description: this isn't really more advanced than "Hello, World!", but it does show +an eLua specific module: the platform data module (pd). You can read +more about the platform modules ##here. The program will display the platform name, the CPU name, the board name and the CPU clock and then will exit -to the shell.
Commented Source Code:
-- Uses module pd to access platform data and print it on the Terminal
print( "I'm running on platform " .. pd.platform() )
print( "The CPU is a " .. pd.cpu() )
print( "The board name is " .. pd.board() )
Runs on:
All targets except i386
Description:
-Now we get to do something "more embedded": blink a LED. The code ilustrates a few interesting eLua features:
cross platform code: the code assigns a different pin +
Runs on: all targets except i386
+Description: now we get to do something "more embedded": blink a LED. The code illustrates a few interesting eLua features: +
uart, pio, tmr, pd modules: they are all used here.
Watch it blink, then press any key to return to the eLua shell.
-Watch it blink, then press any key to return to the eLua shell.
Commented Source Code:
- -Runs on:
All Targets except i386
Description:
By far the geekiest example from the eLua distribution (or would it be morse.lua? :), it makes use of
-the term module (docs/terminal_support.txt) to let the user play a
-BSD-like "hangman" directly in his terminal emulator. Run the example
+
Runs on: all targets
+Description: the geekiest example from the eLua distribution (or would it be morse.lua? :), it makes use of +the ##term module to let the user play a BSD-like "hangman" directly in his terminal emulator. Run the example and enjoy. Currently it has a very small list of words, as this was written mainly as a proof of eLua's capabilities, but it's very easy to -add new words/replace the existing ones. A screenshot can be seen here.
+add new words/replace the existing ones. A screenshot can be seen ##here. -Runs on:
EK-LM3S8962, EK-LM3S6965
Description:
-This uses the PWM module to fade the on-board LED in and out, in an
+
Runs on: EK-LM3S8962, EK-LM3S6965
+Description: this uses the PWM module to fade the on-board LED in and out, in an infinite loop. Not much to say here, the code is very simple, yet the results are quite spectacular. Press any key to end the sample and -return to the shell.
+return to the shell. -Runs on: MOD711
+Description: My MOD711 board needed a +"motherboard" for a few components (mainly the RS232-TTL level converter and a reset button) so I also added two LEDs to it, connected +to two different PWM channels. With this program, the two LEDs fade at the same type, but in different directions.
-Runs on:
EK-LM3S8962, EK-LM3S6965
Runs on: EK-LM3S8962, EK-LM3S6965
+Description: a very simple, incomplete implementation of the famous pong +game. It uses the display and keys on the EK-LM3S8962 or EK-LM3S6965 boards. It uses a platform dependent module (disp) and also shows how +require can be used from eLua.You can set different game speeds. Enjoy! :)
-Description:
This is more complex, but also very important for eLua, because it
+
Runs on: EK-LM3S8962, EK-LM3S6965
+Description: this is more complex, but also very important for eLua, because it
proves that real time applications (with relatively strict timing
-requirements) can run from eLua directly. It's the famous TV-B-Gone
-project adapted from LadyAda's kit.
+requirements) can run from eLua directly. It's the famous TV-B-Gone
+project adapted from LadyAda's kit.
If you're not familiar with TV-B-Gone, it knows how to do one thing
very well: power off your TV :) Basically it contains a lot of remote
control codes (for a lot of TVs) that are continously sent via an IR
-LED. This code uses the PWM module (new in eLua 0.4) and it also does
+LED. This code uses the PWM module (new in eLua 0.4) and it also does
file I/O from Lua, since the remote control codes are kept in a
separate file (which is also part of the ROM file system). To read the
binary file, the "pack" module (also new in 0.4) is used. To ensure
that we don't get any unexpected delays, the Lua garbage collector is
turned off. Take a look at this sample, it's both a very good proof of
-the capabilities of eLua and a good learning resource. To use it on any
-of the Cortex boards (EK-LM3S8962 or EK-LM3S6965) connect an IR LED
+the capabilities of eLua and a good learning resource.
+To use it on EK-LM3S8962 or EK-LM3S6965 connect an IR LED
with a resistor between the "PWM2" and "GND" pins of the extension
connector. Get close to your TV and press the "select" button on your
board to start sending the IR codes. The on-board LED stays lit while
the codes are transmitted and shuts off afterwards. Press the "down"
-button on your board to exit the application and return to the shell.
Runs on:
EK-LM3S8962, EK-LM3S6965, SAM7-EX256
Description:
-Yet another use for the PWM module, this sample can be used to "play"
+
Runs on: EK-LM3S8962, EK-LM3S6965, SAM7-EX256
+Description: yet another use for the PWM module, this sample can be used to "play" notes via the on-board speaker using the PC keyboard. The on-screen keyboard shows what keys you must press for different notes, and you -can set your octave and inter-note delay. Press ESC to end your eLua -musical session :) A screenshot can be seen here.
+can set your octave and inter-note delay. Press ESC to end your eLua +musical session :) A screenshot can be seen here. -Runs on:
All Targets
Description:
This is taken directly from the official Lua distribution, and it's
-here to show that eLua can do floating point just like on a desktop
+
Runs on: all targets
+Description: this is taken directly from the official Lua distribution, and it's +here to show that eLua can do floating point just like on a desktop machine, albeit slower. Run it on your target, then run it again, but -this time on the PC, and compare the results. Yes, they are identical.
+this time on the PC, and compare the results. Yes, they are identical. -Runs on: i386
+Description: another example taken directly from the Lua distribution, this time +the well known game of life. +Start it and enjoy. Only included on i386 by default because it's faster on i386, but it can run on other +platform too (although it requires quite a bit of memory, which is not a problem for boards with external +memory).
-Runs on:
EK-LM3S8962, EK-LM3S6965, SAM7-EX256
Description:
This uses the same PWM module for Morse code generation. Just enter a
+
Runs on: EK-LM3S8962, EK-LM3S6965, SAM7-EX256
+Description: this uses the same PWM module for Morse code generation. Just enter a text, and listen to it getting Morsed on your board's speaker and on a blinking Led. The letters and Morse codes are also shown on the terminal. Use '+' and '-'' to change the frequency, up and down arrows to change the speed, -'s' to mute/unmute, and ESC to exit.
+'s' to mute/unmute, and ESC to exit. -Runs on:
EK-LM3S8962, EK-LM3S6965
-
-
Description:
This is one of those things that can show the real potential of a
-language (and hopefully the real potential of eLua in this case). As
+
Runs on: EK-LM3S8962, EK-LM3S6965
+Description: this is one of those things that can show the real potential of a +language (and hopefully the real potential of eLua in this case). As you have probably guessed by now, it's a web server written in Lua. -Except that it is much more than this: it's a scripting web server! That's +Except that it is much more than this: it's a scripting web server! That's right, you can embed parts of Lua code into your pages, and the server will parse them and replace the Lua code with its output. To output something from Lua code embedded in a web page, simply use "print" in @@ -139,6 +140,18 @@ and replace the Lua code with its output
This is still work in progress, but it already works quite well. -Take a look at romfs/index.pht and romfs/test.lua from the source +Take a look at romfs/index.pht and romfs/test.lua from the source distribution for an example of how to include Lua code in your HTML -files.
\ No newline at end of file +files. + +Runs on: ##TODO
+Description: ##TODO +
+ + +Runs on: ##TODO
+Description: ##TODO +
+