Posts with «software» label

Alternative displays for HDSP or WiFiChron clocks

So you would like to build your own HDSP clock or WiFiChron clock but you find the HDSP-2534 display too small or too expensive. Why not just replace it with a bigger 8-character display, like the 1-inch 8 x 16-segment or two cascaded Adafruit 0.54" 4 x 14-segment backpacks? We have you covered, in software. Both these displays are now supported, as extension classes of the DAL (Display Abstraction Layer), together with the 128x64 I2C OLED and the HT1632-based 32x8 LED matrix display (used to be from Sure  Electronics). Support could be further extended to LCD displays (think big font on 40x4), MAX6955 with 6x16 segment etc., basically anything that can show 8 alphanumeric characters (numbers only, like regular Nixie tubes, would not suffice).

Below are some examples.

Two Adafruit 4-character backpacks are connected on I2C, addresses 0x70 (default) and 0x71, handled by class DisplayAda14seg, which in turn uses the Adafruit_LEDBackpack library.

To enable this display, uncomment the line (in DAL.h, comment out the rest):
#define DISPLAY_ADA_14SEG  // 2 x Adafruit 4x14seg displays;

Functionality for the 8x32 (or 16x32) LED matrix display is implemented in class DisplayHT1632, which is based on code recycled from Wise Clock 4. To enable this display, simply uncomment the line (in DAL.h, comment out the others):
#define DISPLAY_HT1632	 // Sure 8x32 LED matrix controlled by HT1632;

To accommodate the 8 characters on a 32-pixel line, fontTiny had to be used (each character is 4 pixels wide).

Other possible definitions in DAL.h are:
// Define the display you wish to use here.
// Comment out the ones not used.

//#define DISPLAY_HDSP2534 // original HDSP-2534 display in HDSP clock;
//#define DISPLAY_HUB08 // TODO: 8x32 LED matrix display with cascading shift registers (?)
//#define DISPLAY_DL1414 // 2 x DL1414; tested June 23, 2018 (
//#define DISPLAY_HT16K33 // my 8x16-segment driven by HK16K33, tested Jul 26, 2020;
//#define DISPLAY_OLED // I2C OLED; tested
#define DISPLAY_HT1632 // Sure 8x32 LED matrix controlled by HT1632; tested Aug 14, 2020;
//#define DISPLAY_MAX6955 // TODO: 8x16 segment driven by MAX6955
//#define DISPLAY_LCD1602 // TODO: classic LCD 16x2 (or better 40x4, with big font);
//#define DISPLAY_ADA_14SEG // 2 x Adafruit 4x14seg displays, wired on 0x70 and 0x71 I2C addresses; tested Jul 26, 2020;

// show time on the 60-pixel Adafruit Neopixel ring;
//#define _ADD_NEOPIXEL_

And so on.

Optimizing GIF Playback For Microcontrollers

Despite being cooked up by Compuserve back in the late 1980s, GIFs have seen a resurgence on the modern internet, mostly because they’re fun. However, all our small embedded systems are getting color screens these days, and they’d love to join in the party. [Larry Bank] has whipped up a solution for just that reason, letting embedded systems play back short animated GIFs with limited resources.

[Larry] does a great job of explaining how the GIF format works, using LZW compression and variable-length codes. He talks about how the design of the format presents challenges, particularly when working with microcontrollers. Despite this, the final code works well, and is able to work with most animated GIFs of the right dimensions and construction. 24K of RAM is required, and image width is limited to 320 pixels. Images can be loaded from flash, memory, or SD cards, and he notes that best performance is gained with a microcontroller with fast SPI for writing to screens quickly.

It’s a great piece of software that promises to add a lot of charm, or silliness, to microcontroller projects. It also simplifies the use of animations, which can now be designed on computers rather than by using onboard graphics libraries. GIF really is the format that never seems to die; we’ve featured cameras dedicated to the form before. Video after the break.



Hack a Day 04 Aug 03:00

Sure 32x16 display (HT1632) driven by ESP32

I was recently awoken from the Netflix-induced lethargy by an email from LukeW, who needed help with running the Wise Clock 4 on ESP32. What a great idea that is!

I had an epiphany when I realized what a great development board this is: unbelievable price (about $10 on amazon), great performance (memory, speed, WiFi, BT, BLE etc.), amazing support (Arduino IDE, libraries, examples etc.).

The latest Arduino IDE I had was version 1.6.7 (2017). Trying to install the support package for ESP32, I got a security error along the lines: PKIX path building failed: unable to find valid certification path to requested target.

It works fine when downloading it through the browser (, meaning that the server certificate used for esspressif is not recognized by the JVM run by Arduino (folder "java" in the arduino directory). Identifying and adding the certificate to the JVM's keystore is time consuming, so I decided that it is just easier to upgrade to the latest Arduino IDE (currently 1.8.12), installed this time (a first for me) from Microsoft store. Even though the process is seamless, I have no idea where this software was placed (definitely not where I wanted it). I also learned the new way (where have I been for so long?) used for including and managing libraries ("Add .ZIP library").

Using the ESP32 module is as easy as the first Arduino (Duemilanove). The only thing one needs is a solderless breadboard, which I was lucky to have one around, since I don't remember ever using one before. An interesting fact is that the ESP32 board inserted in the breadboard I have, leaves room for connecting wires only on one side.

Next step was to connect the Sure 32x16 displays (two, daisy chained). I used these pins:

// pins used to connect to ESP32;
#define HT1632_DATA      12 // Data pin (pin 7 of display connector)
#define HT1632_CS            14 // Chip Select (pin 1 of display connector)
#define HT1632_WRCLK  13 // Write clock pin (pin 5 of display connector)
#define HT1632_CLK         27 // clock pin (pin 2 of display connector)

With only the pin changes, the HT1632 files used in Wise Clock 4 software work perfectly fine with ESP32. They can be found here, called from a test sketch that uses 2 displays (#define NUM_DISPLAYS 2 in file MyHT1632.h).

SD card should be next, using the ESP32 support libraries. With ESP32, the sky is the limit: hopefully no more program memory limitations, no need for third party libraries (e.g. Sanguino), better support for sound, easier access to WiFi, support for extra peripherals etc.

The Arduboy, Ported To Desktop and Back Again

A neat little hacker project that’s flying off the workbenches recently is the Arduboy. This tiny game console looks like a miniaturized version of the O.G. Game Boy, but it is explicitly designed to be hacked. It’s basically an Arduino board with a display and a few buttons, anyway.

[rv6502] got their hands on an Arduboy and realized that while there were some 3D games, there was nothing that had filled polygons, or really anything resembling a modern 3D engine. This had to be rectified, and the result is pretty close to Star Fox on a microcontroller.

This project began with a simple test on the Arduboy to see if it would be even possible to render 3D objects at any reasonable speed. This test was just a rotating cube, and everything looked good. Then began a long process of figuring out how fast the engine could go, what kind of display would suit the OLED best, and how to interact in a 3D world with limited controls.

Considering this is a fairly significant engineering project, the fastest way to produce code isn’t to debug code on a microcontroller. This project demanded a native PC port, so all the testing could happen on the PC without having to program the Flash every time. That allowed [rv] to throw out the Arduino IDE and USB library; if you’re writing everything on a PC and only uploading a hex file to a microcontroller at the end, you simply don’t need it.

One of the significant advances of the graphics capability of the Arduboy comes from exploring the addressing modes of the OLED. By default, the display is in a ‘horizontal mode’ which works for 2D blitting, but not for rasterizing polygons. The ‘vertical addressing mode’, on the other hand, allows for a block of memory, 8 x 128 bytes, that maps directly to the display. Shove those bytes over, and there’s no math necessary to display an image.

This is, simply, one of the best software development builds we’ve seen. It’s full of clever tricks (like simply not doing math if you’ll never need the result) and stuffing animations into far fewer bytes than you would expect. You can check out the demo video below.

Arduino IoT Cloud: Dynamic Dashboard

In this short article we are going to have a look at a new exciting feature: theDynamic Dashboard of Arduino IoT Cloud.

Among other things with Arduino IoT Cloud you can create a dashboard to monitor data and interact with your project.

If you want to know more about properties and widgets you can go here

Now it’s possible to arrange the widgets as you like. You can also increase their size and move them around following your needs.

In order to resize them simply drag the small resize handle in the right bottom corner of each widget. This way they become dynamic and the widgets below will adjust and rearrange accordingly.

How to resize properties boxes

For now, Location and String are the only resizable widgets.

If you want to move the properties around just click and drag the title area.

How to move properties boxes

Below you can see the callbacks used in this easy example

void onLatitudeChange() {
  lat = Latitude;
  GPS = {lat, lon};
  Locations += "lat: " + String(lat) + "; " + "lon: " + String(lon) + "\n";
  Movements ++;

void onLongitudeChange() {
  lon = Longitude;
  GPS = {lat, lon};
  Locations += "lat: " + String(lat) + "; " + "lon: " + String(lon) + "\n";
  Movements ++;

If you want to further experiment on how multi-value properties work here’s an example


Arduino IoT Cloud: April’s New Features

In this short article, we are going to provide an overview of all the new and exciting features the team has been working on.

Multi-Value Property Types: The first two types implemented are Location and Color. With Color, you can pick a color from the palette (clicking on it) or just show one in a small window. With Location, you can see a pin on a map and move it; furthermore, you can drag the box and make it bigger

The number of property types is huge, allowing you to pick the one that best suits your needs. All the possible values are taken from the SenML standard.

Shadow Thing: If a device happens to disconnect from the Cloud, as soon as it reconnects, the board will get back its previous property values. For example, if a property controls the status of a lamp, and the lamp property is set to on, the light will be kept on when the device comes back online.

Simply Discover Your Thing ID and Device ID: The panel showing information about its associated board is opened by default, making it easier to read details about the board you are using.

Getting Started Procedure: The procedure is now faster and more reliable, thanks to bug-fixing and a new connection template used in the Cloud_blink sketch.

Mondrian clock software release

Unbelievably, there is still demand for the Dual LED matrix shield for Arduino, which also pressures me to maintain and upgrade the supporting software, usually on client's request.
And that is how the Mondrian clock got a couple of new display modes: one picked directly from the Cube clock, showing just hours and minutes, the other one an improvement of the same, with the addition of a red dot moving around the rectangular clock face to indicate the seconds.
The display mode changes when both buttons are pressed simultaneously.

Here is the clock in action.

The Mondrian clock uses the Dual LED matrix shield and wsduino (as an RTC-equipped and XBee-supporting Arduino-compatible).
The code is available here. There is no GPS support, but that can be copied and adapted from the previous version of Mondrian software.

Note that the LED matrix shield was designed to accommodate either the common-anode or the common-cathode LED matrices, by soldering the correct LED driver, either A2982 or ULN2803 respectively. In the software, use either one of these defines:
#define _COMMON_ANODE_
//#define _COMMON_CATHODE_

The only user interface on the shield is the pair of buttons. Pressing the left one will increment the hours, the right one will increment the minutes, while the seconds are always reset.
By pressing both buttons at once, the display mode cycles through Mondrian mode (red hours, green minutes, orange seconds), 24-hour mode (HH:MM in green), 12-hour mode (HH:MM in orange), and moving second red dot (12-hour, HH:MM in green, more square font).

Getting started with the Arduino IoT Cloud

As previously announced, the Arduino IoT Cloud is an easy to use Internet of Things application platform that enables developers to go from unboxing their board to a working device in just minutes.

To help you get started, we’ve put together a quick project that’ll walk you through connecting a MKR1000 (or MKR WiFi 1010) to the Arduino IoT Cloud.

By the end of the tutorial, you’ll be able to control and monitor your board over the Internet using the Arduino IoT Cloud site.

First, we’ll add the board to the Arduino IoT Cloud as a Thing — a representation of the board in the cloud. We’ll then give the Thing a set of Properties which represent sensors, LEDs, motors, and many other components in the project that you’ll want to access from the cloud.

Want to see more? You can find the entire step-by-step guide here.

Announcing the Arduino IoT Cloud Public Beta

In our pursuit to democratize Internet of Things development, today we are excited to announce the Arduino IoT Cloud!

The Arduino IoT Cloud is an easy-to-use platform that makes it very simple for anyone to develop and manage their IoT applications, then deploy them to a large number of users. It allows users to create applications that solve real-life problems, and hopefully, improve their lives.

With the launch of the Arduino IoT Cloud, Arduino now provides its one million users a complete end-to-end approach to IoT that includes hardware, firmware, cloud services, and knowledge. After six months of private beta testing, I am very pleased to release the public beta of the Arduino IoT Cloud with automatic dashboard generation, Webhooks support, and full TLS secure transport.

— Luca Cipriani, Arduino CIO

Convenience and flexibility are key considerations for the Arduino IoT Cloud. Arduino boards usually require you to program them by entering code by way of a sketch — now the Arduino IoT Cloud can do this for you. It will quickly and automatically generate a sketch when setting up a new thing, thus enabling a developer to go from unboxing their board to a working device within five minutes. The Arduino IoT Cloud also provides other methods of interaction, including HTTP REST API, MQTT, Command-Line Tools, Javascript, and Websockets.

Going from an idea to a fully-functional IoT device has been a tedious process even for the most advanced engineers and developers… until now. Arduino now offers a complete platform with the MKR family providing a streamlined way to create local IoT nodes and edge devices using a range of connectivity options and compatibility with third-party hardware, gateway, and cloud systems. Whilst the Arduino IoT Cloud lets users manage, configure and connect not only Arduino hardware but the vast majority of Linux-based devices — truly democratizing IoT development.
— Massimo Banzi, Arduino CTO and Co-Founder

Want to learn more or try out the Arduino IoT Cloud for yourself? You’re just a click away!

Announcing the Arduino Command Line Interface (CLI)

The Arduino team has been working hard to support the needs of our professional developer community. Many of you requested a way to use our tools in Makefiles, and wanted Arduino IDE features available via a fast, clean command line interface.  How cool would it be to install project dependencies with:

arduino-cli lib install “WiFi101” “WiFi101OTA”

So that’s what we’ve done! To make it even cooler, most Arduino CLI commands have the option to output JSON for easy parsing by other programs:

arduino-cli –format json lib search wifinina

{“libraries”:[{“Name”:”WiFiNINA”,”Releases”:{“1.0.0”:{“Author”:”Arduino”,”Version”:”1.0.0″,”Maintainer”:”Arduino \\u003e”,”Sentence”:”Enables network connection (local and Internet) with the Arduino MKR WiFi 1010, Arduino MKR VIDOR 4000 and Arduino UNO WiFi Rev.2.”,”Paragraph”:”With this library you can instantiate Servers, Clients and send/receive UDP packets through WiFi. The board can connect either to open or encrypted networks (WEP, WPA). The IP address can be assigned statically or through a DHCP. The library can also manage DNS.”,”Website”:””,”Category”:”Communication”,”Architectures”:[“*”],”Types”:[“Arduino”],”Resource”:{“URL”:””,”ArchiveFileName”:””,”Checksum”:”SHA-256:79f133fedf86411ca7add773a4293137dec057a3b8f1a7904db2d444ed8f4246″,”Size”:65651,”CachePath”:”libraries”}}}}]}

The other big news is you can run Arduino CLI on both ARM and Intel (x86, x86_64) architectures. This means you can install Arduino CLI on a Raspberry Pi or on your servers, and use it to compile Sketches targeting the board of your choice (Don’t forget you can also remotely manage your Linux device with Arduino Create Device Manager!)

Getting Started

This first release is an alpha, and we would like your feedback to help us improve it. You can download the Arduino CLI alpha preview binaries from:

Linux (64-bit):

Linux (32-bit):

Linux (ARM):



Once you’ve installed Arduino CLI, you can try it out using our getting started guide:

The Arduino CLI code repository is also available at: As usual, it’s open source – but if you’re a company who wants to use it to create a customized tool, you can also contact us for a commercial license.

Integrate Arduino Support Into Your Preferred Platform

After we used Arduino CLI for awhile, we decided to make it the standard way our software communicates. Imagine having the Arduino IDE or Arduino Create Editor speaking directly to Arduino CLI – and you having full control of it. You will be able to compile on your machine or on our online servers, detect your board or create your own IDE on top of it!

We want you to be able to add Arduino support to whatever development flow you prefer. Whether you use Atom, Eclipse, Emacs, Vim, VSCode, or are even building your own tools, Arduino CLI makes this possible. Let us know what you think!