Hi, the project I'm doing at the moment is the following: I have a sensor that detects the Amps arriving in the house, connected from it to Arduino Uno I calculate a series of variables and print them on the serial monitor; so far no problem.
I however want to print what I see on the serial warning on a TFT screen, specifically this:
http://www.lcdwiki.com/3.5inch_Arduino_Display-Mega2560
This shield is connected to an Arduino Mega and is connected via TX / RX to the Arduino Uno to which the sensor is connected. The communication between the two works without problems.
I have no experience with this type of monitor soi don't know what type of instruction i have to use, looking on the internet I created the following code but for about two weeks I have not yet been able to print completely what comes to the arduino Mega.
What do you advise me to do, do you have experience on this monitor?
#include <LCDWIKI_GUI.h> //librerie, colori e inizializazione schermo
#include <LCDWIKI_KBV.h>
#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF
LCDWIKI_KBV mylcd(ILI9486, A3, A2, A1, A0, A4);
char Test1 [106]; //variabile in cui salvo ciò che arriva dal serial monitor
void setup()
{
Serial1.begin(9600); //serial 0 occupato dal monitor, utilizzo serial 1
mylcd.Init_LCD(); //inizializzo schermo
mylcd.Fill_Screen(BLACK); //schermo tutto nero
delay(1000);
}
void loop()
{
{
if (Serial1.available())
//int array[107] = { 0 }; //altro tentativo
//char Test1[107] = {Serial1.read()}; //altro tentativo
//String (Serial1.read()) = String Test1; //altro tentativo
Test1 = Serial1.read(); // la stringa che arriva al serial lo salvo nella variabile
}
mylcd.Set_Text_Size(3);
mylcd.Set_Text_Back_colour (BLACK);
mylcd.Set_Text_colour (WHITE);
mylcd.Print("Valori dal Sensore :", 5, 6);
mylcd.Set_Text_Size(2);
mylcd.Set_Text_Back_colour (BLACK);
mylcd.Set_Text_colour (WHITE);
//mylcd.Draw_Char(5, 80, Test1, WHITE, BLACK, 2, 0);
mylcd.Print(Test1, 5, 100);
delay (1000);
mylcd.Set_Text_Size(2);
mylcd.Set_Text_Back_colour (BLACK);
mylcd.Set_Text_colour (BLACK);
//mylcd.Draw_Char(5, 80, Test1, BLACK, BLACK, 2, 0);
mylcd.Print(Test1, 5, 100);
delay(250);
}
