# In search of the creator of the 'scales' TFT ring meter display subroutine

I am working on an Arduino powered TFT display device that attractively displays input and return temperatures in my central heating / floor heating system.
On Instructables.com I found an analog ‘ring’ meter contribution dated March 17, 2015 by Bodmer that beautifully display values in a certain range with circle like "ring’ meters.

(https://www.instructables.com/id/Arduino-analogue-ring-meter-on-colour-TFT-display/). The ring_meter.zip contains a sketch which carries on line 17 the name ‘Alan Senior’ and the date 18/3/2015

This sketch did not work immediately with my ILI9481 TFT screen (blank!), but I managed to get a working screen with nice results using David Prentices’ <MCUFRIEND.kbv>> I also copied instructions from a working sketch I found somewhere carrying the name “Danny van den Brands”

The core subroutines that create the brilliant, visual rainbow ‘ring’ representation of the data are:

/ #########################################################################
// Draw the meter on the screen, returns x coord of righthand side
// #########################################################################

int ringMeter(int value, int vmin, int vmax, int x, int y, int r, char *units, byte scheme)
{
// Minimum value of r is about 52 before value text intrudes on ring
// drawing the text first is an option

… etc and:

// #########################################################################
// Return a 16 bit rainbow colour
// #########################################################################

unsigned int rainbow(byte value){
// Value is expected to be in range 0-127
// The value is converted to a spectrum colour from 0 = blue through to 127 = red

byte red = 0; // Red is the top 5 bits of a 16 bit colour value

My question is: does anybody on this forum know the name or pseudonym of the creator of these subroutines? In my final sketch I want to credit thos e who deserve credit - and the one who has programmed these great routines certainly deserves it in my eyes!

Think about it. Any graphic image is going to be built from circles, rectangles, lines, ...

If you see a nice image, you just have to break it down into the core shapes.

Most graphics library functions have intuitive arguments. So it is easy to re-write for your particular software.

Some graphics are expensive to compute. e.g. triangles, filled arcs, segments, ...

I don't know where Bodmer got his Ring example.
I know that I have stolen it from Bodmer.
And I am sure that many people will port, adapt, modify, ... in the future.

Regarding "cost". All libraries can draw the shapes. But some do it more efficiently than others.

David.

Hi David,

Who could be 'Alan Senior'?

I assume that many routines have been written in the past for quite some other displays than nowadays TFT and OLED screens for Arduino. Maybe the original one was written back in the mist of time for the purpose of decorating data on a tube oscilloscope.

This particular subroutine is very clever in that it builds up, circle wise, every three degrees a marking that consists of two triangles: one with the base directed outward and one with the base directed inward. And that is combined with a 'rainbow' subroutine that mixes colors. Brilliant use of triangle drawing! These subroutines should work with any graphic library that is capable of drawing closed triangles.

Cheers, Floris

He did a comment on youtube 2 years ago: