JOS – Open Source Menu Interface for Arduino/TFTLCD

***UPDATE*** There is updated code that works with the current Adafruit libraries! New post is here. 🙂

So I ordered a 2.8″ TFTLCD with touchscreen from Adafruit and really wanted to do more than 1 “screenfull” of stuff. So I stayed up all night and wrote this. Now I want to share it. I was waiting to post this until I got my code a little cleaned up and put in a good number of comments. My code might not be as optimal as it could be, so go easy on me, I’m still a newbie..

Here is a video about what this does.

And here is a video about the code.

JOS stands for Jeremy’s Operating System and is open source. I encourage you to use it, hack it, and do what ever you want with it. I know some might say “it’s not an operating system!” I know, but it’s just a name. It is based on Lady Ada’s TFTLCD and TouchScreen libraries. It shares some of the code from Lady Ada’s tftpaint sketch found in the TFTLCD library. It is written in the Arduino IDE and works perfect with the 2.8″ TFTLCD breakout board and the Touch Shield. This version does not support and SD card/bitmap functions as I do not have a touch shield yet. I will write these in when I get a Touch shield some day.

Here is a feature List:

Menu driven button screens

5 different menu screens, 6 buttons per screen for a total of 30 separate functions

Customizable title bar for indicators, custom icons and titles

Easily adjustable dual color signal indicator (for wireless application) for the title bar

Home icon for easy navigation

Dedicated message box for notifications

PWM controlled adjustable backlight

Settings menu with adjustable sleep time and backlight

Sleep and backlight settings saved in EEPROM – retains settings after power down

Sleep mode, for backlight, including fade in from sleep  and fade out to sleep

Template for 3rd adjustable item on settings menu

Dual color battery icon with active and adjustable monitoring

LED output for button press indication – adjustable or removable

2 LED outputs for indication – adjustable or removable

All LED activity used only 2 pins

pins 0 and 1 not used and reserved for for serial communication

pins 11, A0, A1, A4, A5 open for I/O

Code is commented to explain function

Hardware Wiring: The same wiring as found in the Adafruit TFTLCD tutorial here. Continue reading