Electronic – Embedded system scripting

sdusb

Does anyone have some cool ideas for a use of a scripting language on an embedded system? I'm thinking about the eLua project specifically.

Basically, you need a micro with at least 64k of RAM, 256k of Flash, the Newlib C library, and a gcc compiler, (AVR32, ARM7, Cortex-M3 are all supported right now among others), and you can send it (or program it to load) scripts. It doesn't need an OS, but it lets you use your micro (which is far too small for embedded Linux) much more like a general purpose computing device, by allowing programs not flashed into the program memory to be run.

The current project has a number of example applications, but none of them seem to do anything that you can't do with a program burned into Flash. The big difference that I can see is that you can send each program separately, and run different programs without resetting. In addition, you can use it interactively (Change your program flow with your decisions at the keyboard, rather than having to code everything.

How would you use such a device? Would you give it a keyboard and character LCD, and write your own scripts while it sat on your desk? Would you simply use the scripting language to simplify programming of more complex applications? (Like the games currently available on the project site?) Or would you do something completely different? I'm getting started with it and looking for project ideas.

Edit: You can send it programs over whatever protocol you want to use (UART, SPI/I2C etc., USB, Ethernet), load them from an SD card, whatever your chip supports. Just wanted to clarify that it didn't have to be in a reprogramming-friendly environment.

Edit2: Most of my projects are for my personal use, or for sharing with like-minded friends, not often for sale to the general public. I expect users of my projects to be interested in and familiar with embedded systems, and able to pick up the rudimentary use of a scripting language without too much trouble. I might use them around the house or in the car, or more likely in the shop as an aide to designing and debugging more new projects. I also might propose it to my boss at work, where we manufacture and design embedded systems. Or, I might use it on an engineering project for school.

Best Answer

I'm planning on embedding a scripting language in my little mom-find-me device (finally progressing again, hope to have a working prototype by the Detroit Maker Faire next month).

It's a little platform with GPS, compass, SD card, and zigbee that is meant to help my keep track of my younger kids at large parks, and to give them a way to easily find me when they need me.

The embedded scripting language will provide a protected sandbox where simple applications, such as games, maps, geocaching programs, or multiplayer games (several kids, each with a unit can play enhanced versions of capture the flag, hide and seek, tag, etc) without affecting the base function of being able to track my kids. These would go on the SD card as text files so they can easily be edited and updated with no special hardware or software.

There are lots of other ways and reasons to use a scripting language in embedded systems, but in order to see how or why it might fit into your needs we'd have to understand more about your particular system.

Related Topic