Print Variables on evive TFT Display Line by Line

Description
Learn to print the value of variables on the TFT display screen of evive line by line using the print() and println() functions. In this tutorial, you will learn to read the analog value of Pot 1 and print it on the TFT Monitor.

Introduction

In this tutorial, you will learn to print the value of variables on the TFT display screen of evive line by line. It is printed in the same way as the value of variables is printed on a serial monitor continuously in Arduino IDE. If you are not friendly with the evive display screen then it is advisable for you to check the tutorial related to getting started with TFT display.

Arduino Sketch

In this example, the analog value of Pot 1(pin A9) is read and printed on the TFT monitor using function print() and println() functions.

/*
	This example shows how to plot any variable on evive TFT display.

  Explore more on: https://thestempedia.com/tutorials/tft-monitor/
  Created by Dhrupal Shah.
  
  This code is in public domain.
  
*/

#include<evive.h>                         //include evive library

TftMonitor tft_Monitor;                     // Initialize a class object

void setup(){
  tft_init(INITR_BLACKTAB);               //Use either INITR_BLACKTAB or INITR_GREENTAB. Initialize TFT screen in library screen.cpp
  tft_Monitor.begin();                     // Begins tftMonitor
  pinMode(A9,INPUT);                      // Set pin as input mode (POT1 = A9) 
}

// the loop function runs continuously when you select the user defined function
void loop(){
  tft.setTextColor(ST7735_WHITE,ST7735_BLACK);
  tft_Monitor.print("Pot 1 value: ");
  tft_Monitor.println(analogRead(A9));     // Pot1 Value is printed on TFT Monitor
  delay(50);
}

Conclusion

In this tutorial, you learned how to print the value of variables on the TFT display screen of evive line by line. You also learned how to use the print() and println() functions to display the value of Pot 1 on the TFT Monitor. The analog value of Pot 1 was read and printed on the TFT monitor using these functions.

Table of Contents