I did it, I finally found some down time to update JOS to work with current libraries from Adafruit. Below is a link to the new code on Github. A few notes to look at are listed below.
First, this is code for the Touch Shield, but it can easily be changed to the breakout board, and don’t forget to uncomment the ‘#define USE_ADAFRUIT_SHIELD_PINOUT’ line in Adafruit_TFTLCD.h file.
Also, this sketch has pin 3 setup as the backlight on the shield. This way you have PWM control over the backlight. You can accomplish this by cutting the VCC trace and soldering the PIN3 jumper on the back of the shield. You can read more on how to do that here.
This sketch has EEPROM settings, if you have not used them before, the values will be zero and need to be set. There are notes about this in the sketch on lines 92 & 93.
I wanted to give a tour/crash course on automation systems, so I put together a video showing some of what an automation system can do. I ran through everything kind of fast, so I will do more videos getting into more details on specific functions of sub systems, like lighting, audio, security, etc. This video also shows my RGBW Controller working in my house. 🙂
The system I have is an HAI Omni Pro II. I have been installing automation systems since 2005, and they have proven to be an awesome choice.
For a future project, I would like to replace the Omni with a BeagleBone. 🙂
OK, so I haven’t posted in a while because I have been working on some bigger projects, but yesterday, I took a two hour break and made a 2 player tic tac toe game. I did this with an Arduino and a 2.8″ touchshield from Adafruit.com. It’s pretty basic tic tac toe, and has score tracking, game logic (you can’t go twice in a row, and telling you if you win), and the ability to consume a chunk of time playing tic tac toe with my son. Below is the code, feel free to hack modify etc. If you play against a smart person (or yourself), you will have lots of Mosfet eye games! 🙂
OK, so a while ago I fell in live with these Nokia 5110/3310 LCD displays. They use a library from adafruit.com that you can find here. They are small, fast, and don’t gobble up a lot of current. So I needed a project to make so I could use one. The result? A massive overkill of an LED controler with all kinds of options and features.
So I was thinking about a RGB to HEX Color converter that I had made for the 2.8″ TFTLCD, and the fact that I might want to figure out values without erasing my sketch I’m working on. Although it’s nice to see the color displayed on the screen it will end up on, sometimes you just need a quick answer. Thanks to brookware2000 (in the Adafruit forums), there is a nice small program here that will do the trick. But it runs on Windows, and I’m kind of a Mac guy. The answer? Build one into my nifty little box that already has 8 buttons, an RGB LED, and a nice LCD screen! So here it is.
Download the code here. (Arduino 22 .pde file) This is a version of the code that just has the color converter, I’ll do a video sometime of how to do the dual boot/setup thing.
**Notice the line “PCD8544 nokia = PCD8544(13, 12, 8, 7, 5);” This is not the default pin assignments for the Nokia LCD Tutorial. (default pins are 7, 6, 5, 4, 3) You will need to adjust the wiring for this sketch to work. Pay attention to what pins are used for buttons and LED’s. 🙂
***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