Picture of A Wirelessly Controlled, Arduino-Powered Message Board
Build yourself a wirelessly controlled, Arduino-powered message board!

Here's an easy project which creates a wirelessly programmable message board. It uses XBee modules to provide a wireless serial link between your computer and the device. You interact with it via a simple menu system. There are no buttons (other than the reset button, which is hidden) on the device.

Step 1: What's It All About

The Arduino has three types of memory: flash, EEPROM and RAM. In this project, we use all three to store messages and values. Since we can't change the flash from inside the program, we use it to store 'canned' messages, or messages that don't change. We keep these short so they fit right on the display. We can also use the RAM to store a message, but we don't have much, so we keep that short too. The internal EEPROM is only 512 bytes, but that's enough to store a program of which canned messages to display and for how long. Finally, we add an external serial EEPROM, in which we store a long message (up to the whole size of the EEPROM) that we scroll across the display.

The following programming concepts are demonstrated:
- creating a simple menu system using the serial interface
- accepting and validating strings and integers via the serial interface
- retrieving strings from flash memory using progmem
- storing and retrieving strings in external EEPROM using a simple data structure
- storing configuration data in the onboard EEPROM
- displaying static and scrolling text on a parallel interface LCD (or LCD compatible display)
- measuring an analog value, in this case light levels

supermaggel3 years ago
This is nice!

This is probably really clear, but arduino's API changed over time,
the correct way of doing this would be:

void clearAndHome()
Serial.print("[2J"); // clear screen
Serial.write(27); // ESC
Serial.print("[H"); // cursor to home

Anyone has a tip on which terminal (for OSX) program actually understands these commands? I've tried coolTerm, which doesn't seem to understand this.
Zterm any good? and goSerial? Thanks!
yadoo863 years ago
If you use Arduino 1.0 and you want to clear the screen -like the step 6-, I highly recommend this article: http://www.whatisarduino.org/bin/Tutorials/How+to+clear+Arduino+Serial
uhclem (author) 3 years ago
New version!

I have updated the code so that a Serial.println-type function can be used with "inline" FLASH-stored strings. So, basically, you have code that has a print function and strings where you would expect them in the code, only at compile time they get stored in FLASH and read-from FLASH at execution-time via PROGMEM.

Perhaps at some point Serial.print/println will be rewritten to use prog_uchar instead of char, and then PSTR will be able to provide a pointer it can use directly. But, this method works fine.
Wow nearly all the RAM?

You need to use flash memory more. It looks like you know how but you are still using the "Serial.print", which is going to eat up a lot of RAM.

Use stdio.h , so you can use printf_P


together with avr/pgmspace.h, you can call functions such as

printf_P(PSTR("This string will take no RAM at all"));
uhclem (author)  frank260801154 years ago
These are good comments. The great thing about the Arduino platform is you can succeed right from the start with what's on the arduino.cc website and then later move on to standard avr libraries once you have more experience.
There's a much better way of storing different data types into EEPROM

take a look at http://www.nongnu.org/avr-libc/user-manual/group__avr__eeprom.html

It provides functions for most common datatypes. And for custom datatypes like a struct, simply pass in a pointer to eeprom_write_block, and the length should just be "sizeof" the struct