Everyone might be familiar with Enigma, supervillain in DC Comics Universe. Mostly shown in Batman comics, series and games. Enigma always places intelligent clues that stuck Batman's mind. So, lets build something like it.
Inspired by this article: http://hackaday.com/2012/10/29/qr-clock-is-unreadable-by-humans-and-computers-alike/Background
To build such a clock, QR Code is going to be used to encode current time into it. A QR generation library was ported to the Arduino UNO and Seeed LCD touchscreen platform. Originally the generation time was 6 seconds, making the display of seconds impossible.
As ch00ftech suggested, eliminating the search for the optimal QR mask and instead applying a fixed mask, drops the generation time to less than one second.
Using a Fast TFT display library by Xark allows seconds to be displayed. This library was modified to comply with the calling convention for Seeedstudio libraries, making it a drop in replacement in an existing sketch. By changing a compiler directive, this library can also control an Adafruit LCD.
As a further optimization, the last QR code generated is stored in a bitmap so only the pixels that change are painted.Assembly
Assembly is easy, put together the Arduino Uno and the Seeed TFT Screen.
This project can be enclosed in a laser cut case available from ponoko: http://www.ponoko.com/design-your-own/products/enigma-case-w-2-logos-clear-scratch-resistant-acrylic-12383Uploading Code
Step 1: Install FastSeedTFTv2 Library
Download FastSeedTFTv2 Library from: https://github.com/arduinoenigma/FastSeedTFTv2
Step 2: Install FastSeedTFTv2 Library
Step 3: Download EnigmaQRClock Project
Download EnigmaQRClock Project from: https://github.com/arduinoenigma/EnigmaQRClock
Step 4: Setup Arduino Sketch
.ino file into a separate folder and double click "
EnigmaQRClock.ino" to open sketch in Arduino.
Step 5: Compile & Upload Sketch
Now, compile and upload your sketch to Arduino UNO. Make sure you have attached your SeeedStudio TFT Screen.
Facing error while compiling? You might forget to place one or more
.ino file into your Sketch directory. To open Sketch directory, from Sketch menu -> Show Sketch Folder and place each
.ino file came with project.
Hooray, you made an Enigma QR Clock.Test
Option A: Arduino Serial Monitor
To set the clock by hand open a Serial Monitor window within the Arduino platform, connect at 9600 baud, to set the time to 15:22:25 with an update rate of 10 seconds, type:
Option B: Via Command Prompt
Open Command Prompt and go to folder where
setclock.cmd is available.
setclock.cmd came with your project.
You need a QR application to read the time. For the Android platform, I recommend
QR Droid Private.
App won't decode!
Some QR application does not have capabilities to decode QR image having Black background and White QR block. They are programmed to detect White Background with Black QR Block. In this case, take snapshot of the QR image you want to scan and invert it's color. To invert image's color, you can refer this GIMP tutorial.