SSD1283A instructions

My 130*130 SPI TFT display (SSD1283A controller) is connected to an Arduino Nano that receives data from a DS18B20 temperature sensor. I have created an analog-like gauge using graphical functions offered by the <LCDWIKI_GUI.h> and <LCDWIKI_SPI.h> libraries.
There is one issue that I do not quite grasp. I can translate the temperature reading into a position of the needle. However, I do not know how to print the measured temperature parameter (variable name: temp_01) directly to the display. I first have to convert temp_01 to a string and then print the string to display.

my 'print to TFT subroutine lists as follows:

String tempstring (temp_01,1); // alternative to directly print temp_01
mylcd.Set_Text_colour (WHITE);
mylcd.Set_Text_Back_colour (BLACK);
mylcd.Set_Text_Size (2);
mylcd.Print_String (tempstring,72,10); // string plus y, y position

Is there an easier way than this 'workaround', something that might sound like "mylcd.Print (temp_01,1)". Anybody familiar with all functions offered by LCDWIKI_GUI.h> and <LCDWIKI_SPI.h>?

from LCDWIKI_GUI.h

	size_t Print(uint8_t *st, int16_t x, int16_t y);
	void Print_String(const uint8_t *st, int16_t x, int16_t y);
	void Print_String(uint8_t *st, int16_t x, int16_t y);
	void Print_String(String st, int16_t x, int16_t y);
	void Print_Number_Int(long num, int16_t x, int16_t y, int16_t length, uint8_t filler, int16_t system);
	void Print_Number_Float(double num, uint8_t dec, int16_t x, int16_t y, uint8_t divider, int16_t length, uint8_t filler);

So you can print an integer or a float at (x, y) and even format it nicely. e.g.

    float temp = 19.8;
    myglcd.Print_Number_Float(temp, 1, 72, 10, '.', 4, ' ');

Personally, I think that the LCDWIKI API (Application Programming Interface) is horrible.
It is like UTFT but with every method spelled wrong.

I prefer the Adafruit_GFX methods which are intuitive. (and used by 90% of all Arduino Graphics programs)

David.

Hi David, this single instruction now replaces the value-to-string-and-then-print-to-display subroutine:

mylcd.Print_Number_Float (temp_01, 1, 72, 10, '.', 4, ' ');

.... and here is the result! Now I can tinker with the components Thanks! :slight_smile:

Yes, I noted strange spelling in the LCDWIKI_GUI and _SPI libraries (cursor, Coursor,
mylcd.Set_Draw_color, mylcd.Set_Text_colour, things like that.

Can one run a SSD1283A with the Adafruit_GFX library?

@photoncatcher,

You could search for SSD1283A in the forum.

Or you could try any of the libraries GitHub - ZinggJM/SSD1283A: SSD1283A for Arduino, GitHub - ZinggJM/SSD1283A_SPITFT or GitHub - ZinggJM/ZxTFT: ZxTFT : My TFTs using Adafruit_SPITFT

Jean-Marc

Hi Jean-Marc,

The <LCDWIKI_GUI.h> and <LCDWIKI_SPI.h> libraries were extremely helpful in getting this particular display to work. All the basic graphical functions are available and I was able to create with these libraries my favorite retro-analog gauge.

Without the LCDWIKI suite the little device would't have done much more than displaying gray background. Thanks for creating the libraries. They fully support my SSD1283A based 130*130 TFT display.

regards, Floris

I'll download and try the SPITF library. The instructions in the graphicstest.ino (tft.print) in the GitHub repositry look more familiar than mylcd.Print_String("Hi!",40,70); although the latter is very efficient because the x,y coordinates are included in the instruction.