Close

Checkpoint!

A project log for Hackaday monitor and Lighting Box

Hackaday monitor, artistic light decoration, clock, game and more!

atherosAtheros 08/20/2014 at 23:570 Comments

We've reached a checkpoint in TheHackadayPrize!

In the morning I created the system design required for the first stage of the contest. Later I published Adafruit_Thermal library ported to Spark Core. And now I finished creating a demo of my project, including the required demonstration video... 25 of them... This is the one I think turned out best :)

I forgot to mention in the video the enclosure will be laser cut out of plywood and painted black with RGB LED lighting.

Hopefully this log entry closes the check list of requirements for this stage.

The Thermal Printer

I had some time playing with the printer and it's library. It allowed me to learn a few things about it. For example you can either print a text using a large font or a bold font, not both. An other issue is I cannot print bitmaps on the same line as I draw text, this complicates my plans of having visually appealing prints of weather forecasts and hackaday.com article notifications with a nice skull logo.

The only possibility I see is to generate a bitmap that includes the entire width of the paper on the linux board (logo + text) and send it to the printer. It seems Adafruit_Thermal is prepared for such option with printBitmap(int w,int h,Stream *stream) method. If I have enough time, I will try to implement this, as it seems very fun!

As for the logo images, I used the tutorial from Adafruit for OLED displays that shows how to generate C arrays out of normal images. Unfortunately under wine on linux it generated arrays full of zeros. My solution was to quickly hack my own converter. It did even partially work (see the cloud image printed on the demonstration video). There is some error there I will have to fix later. The code is available in the repository.

The OLED display

While the Thermal Printer was a bit challenging, the OLED display just worked. Everything I was expecting of it, it did provide. All the code worked flawlessly. I guess I will use this kind of displays more often!

The demonstration code

For the demonstration video, I've coded the Spark Core to print a weather forecast and a notification of new article on Hackaday.com. Of course the information printed is hardcoded, but it is just a demonstration. After the print is over, the OLED display is used to display current time and date.

The code is available in the GIT repository. It is currently developed in Spark Cloud IDE, but I think I will deploy a local toolchain so I can work locally in a more traditional fashion. I feel the time between the moment I press "Flash the code" and the moment the code is running on Spark Core is a bit too long, about 3 or 4 minutes. I hope building and flushing through USB will be faster.

What next?

First I'll check if my Olimex OLinuXino-Micro has additional working UARTs (I need two). If it does, it will become the brain of this device. If not, I will be forced to fallback to Raspberry Pi (clearly an overkill for this project).

Once I have a linux board, I will start coding the interface for communication between linux and Spark Core.

I guess that is it. I hope you've enjoyed the video.

Discussions