Getting Started
Welcome to the Screvle getting started guide. This document will explain step-by-step how to write your first application on Screvle.
Getting to know Screvle
Legend
- micro-SD Card Slot
- micro-USB Connector
- Ethernet Link Speed LED (on = 100Mbps, off = 10Mbps)
- Reset Switch (pinhole)
- Ethernet Link Activity LED (on = link active, blink = activity )
- Ethernet Connector (RJ-45)
- LCD + Touchscreen
- RGB LED
- 5-Way Navigation Button
First Things First
Before using Screvle, let's start with a high level overview of how Screvle conceptually works.
By default Screvle runs firmware that provides the easy-to-use web-based Lua Development Environment used to edit, run and debug Lua scripts. This firmware is written in the C programming language. Most users will never change the default firmware, but know that if you want to, you can. More about that later.
New to Lua? Read the Introduction to Lua.
Hello World!
Follow these easy steps to create your first Lua application on Screvle.
1. Power Screvle
Screvle can be powered in several ways, for now, just plug the micro-USB cable into your PC or USB-wall charger. This cable is used purely for power, there is no USB communication possible by default.
Screvle will show the following screen:
2. Connecting Screvle to your PC
By default, Screvle is configured to retrieve its IP address via a DHCP server. If no address can be retrieved after 15 seconds, it falls back to the configured static IP address (by default: 192.168.1.150). Screvle contains an optional DHCP server, capable of providing an IP address to the device it is connected to. The DHCP Server can be turned on by pressing the "DHCP" item and then sliding the "DHCP Server" switch to "ON". It is recommended to turn off the DHCP Client when the DHCP Server is turned on.
When directly connecting Screvle to your PC and subsequently enabling the DHCP server, it is possible that your PC still does not receive an IP address. This is because the PC might have already reconfigured itself by lack of a reply to its initial requests. Unplug and re-plug the Ethernet cable to make your PC try again.
3. Browse to Screvle
Use your browser to load the Lua Development Environment. Point your browser to "http://192.168.1.150" (replace the IP address with the address shown on the display of Screvle if the IP address was retrieved via DHCP). You will see the following webpage:
The Lua Development Environment consists of three parts:
- The list of Lua scripts stored on the SD-card
- The Lua script editor
- Feedback console
4. Create a Console Application
In the Lua Development Environment, press the "+" button at the top left to create a new Lua Script. Call it "hello" and press the "+" button (or enter) to confirm.
The new file is now opened in the Lua script editor and you can start typing your Lua application:
print( "Hello World!" )
Press the Save button:
You application is now ready to run, so press the Run button:
Watch the "Hello World!" string show up in the console:
5. Create a GUI Application
Replace the content of HELLO.LUA with the following code:
hello = mgf.createLabel( "Hello World!" ) mgf.setWidget( hello )
Save and Run and see how the text shows up on the display of Screvle:
Congratulations, you have just created your first Graphical User Interface on Screvle. This concludes the mini getting-started guide. Learn more via the following suggested topics:
What Else? - Get to know Screvle a little bit better.
Using the Lua Development Environment - Learn more about the Lua Development Environment
Lua API Documentation - Learn more about the versatile Lua API