Automatically exported from
C++ Prolog C
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Vortex Manipulator

Mostly inspired by the wrist device worn by Captain Jack Harkness in Dr Who and Torchwood, hence the name. However the design wandered somewhat from that initial idea so the look is a bit different. This is the idea I started with:


Mine is a little different, I needed more space to do what I want, so it is a little bit fatter and it doesn't actually manipulate a time vortex (whatever that is). Instead it has the following functions:

  • Clock with optional beep and led flash once a second, plus a function to set the time. It doesn't adjust automatically for daylight savings etc, but there is a UI to set the time manually.
  • Compass
  • Graphics demo
  • Dalek detector
  • Picture gallery (displays pictures from the SD card)
  • Heart rate monitor, including display graph and data log to SD card.
  • Sleep (power save) function, wakes up when the power button is pressed.

Hardware consists of a Teensy 3.2 mounted on a custom board the Main Board which contains circuitry for charging the attached LiPo battery when the USB port is connected, and an LSM303 to provide compass and accelerometer functions.

A second ILI9341 custom connector board connects to an ILI9341 touch screen. This board has a touch controller and a connector strip that matches the strip on the side of the main board.

There are some configuration settings stored on the SD card (file is hconfig.txt) which consists of the time zone, low pulse and high pulse rates. The pulse rates are used by the HRM to sound alarms if the pulse is outside that range. The time zone is used for the clock (except it isn't actually used now). The other files on the SD card are bmp files used for the picture gallery. These should be 240x320 images.

Perhaps more importantly it is a development platform. There is plenty of spare capacity in the Teensy and there is still plenty of room in the assembly to add more stuff. The Main Board has connectors to unused pins on the Teensy as well.

The assembly is a mix of leather and a 3D printed frame.


Making the Icons

To make the icons I used The Gimp to create a 28x28 pixel image then exported it as a .h file. This .h file cannot be directly used because it is an awkward format. So I pass it through a transformation I wrote in C++, the code looks like this:

const char *pImg = bitmap;

char pRGB[3];
printf("static uint16_t myicon[] PROGMEM = {");
for (unsigned int j = 0; j < size; j++) {


	for (unsigned int i = 0; i < size; i++) {
		pRGB[0] = ((pImg[3] - 33)) | (((pImg[2] - 33)& 0x3)<<6);
		pRGB[1] = ((((pImg[2] - 33) >> 2) & 0xF) | ((pImg[1] - 33) &0xF)<<4);
		pRGB[2] = (((pImg[1] - 33) >> 4) & 0x3 ) | ((pImg[0] - 33)<<2);
		unsigned int colour = ((pRGB[0]) & 0x0000FF)
				| ((((unsigned int) pRGB[1]) << 8) & 0x00FF00)
				| ((((unsigned int) pRGB[2]) << 16) & 0xFF0000);
		unsigned int colour16 = ((colour & 0x0000F8) >> 3)
		         | ((colour & 0x00F800) >> 5)
		         | ((colour & 0xF80000) >> 8);
		pImg += 4;

where bitmap is the generated icon data in the .h file. The result is a 16 bit colour map that can be pasted into the code and the icon rendered using the Graphics.drawPixel(x, y, pixel); where pixel is the 16 bit pixel value from the array.

Making the Gallery Images

These live on the sd card. You can have TFT or BMP format, but BMP is better tested. To make a compatible image go into GIMP and shrink it to 240x320 and export it as a BMP file. Use these options on the export: