2.8'' TFT Touch Shield V2.02.8 and sensor

Hello,

How to print sensor value into 2.8’’ TFT Touch Shield V2.02.8 by using seedTftv2 library. For example like picture below.
F0TV2FQHHMHY8H8.LARGE.jpg

#include <SeeedTouchScreen.h>
#include <stdint.h>
#include <TFTv2.h>
#include <SPI.h>

TouchScreen ts = TouchScreen(XP, YP, XM, YM); //init TouchScreen port pins

char sensorPrintout[4];

void setup()
{
TFT_BL_ON; // turn on the background light
Tft.TFTinit(); // init TFT library

Tft.drawString("BPM",100,190,3,RED);      

Tft.drawString("HEART RATE MONITOR",2,310,1,CYAN);   WHITE

}

void loop()
{
String sensorVal = String(analogRead(A4));

sensorVal.toCharArray(sensorPrintout, 4);

Tft.drawString("sensorPrintout",90,40,2,WHITE);

delay(250);

Tft.drawString("sensorPrintout",90,40,0,WHITE);

}

my code not working :frowning: ,anyone can help me?

Hi jimsathome here

It might be the same problem as mine see my post:
this is it


Most of the 2.8TFT Touch Shield v2 is working. I cut Pin Backlight of 2.8 TFT Touch Shield v2 away from 5v and connected to Pin D7 Pad nearby. Now Arduino Uno R3 can control 2.8TFT Touch Shield v2 Backlight. I changed the touch Pad pins to A0 thru A3, now sketch_touch works. I loaded sketch Demo_draw_circle see next line


/* Demo of draw circle’s APP
drawCircle(int poX, int poY, int r,INT16U color);
fillCircle(int poX, int poY, int r,INT16U color);
*/

#include <stdint.h>
#include <TFTv2.h>
#include <SPI.h>

void setup()
{

Serial.begin(9600);

TFT_BL_OFF;                                          //turn on the background light 

Tft.TFTinit();                                      //init TFT library             

Tft.drawCircle(100, 100, 30,YELLOW);                //center: (100, 100), r = 30 ,color : YELLOW              

Tft.drawCircle(100, 200, 40,CYAN);                  // center: (100, 200), r = 10 ,color : CYAN  

Tft.fillCircle(200, 100, 30,RED);                   //center: (200, 100), r = 30 ,color : RED    

Tft.fillCircle(200, 200, 30,BLUE);                  //center: (200, 200), r = 30 ,color : BLUE                 

}

void loop()
{

}

/***************************************************************************
END FILE
****************************************************************************/

No draw circle but back light flickers because TFTv2.h has code in Tft.TFTinit() turns it on during calls to Tft.TFTinit() code in TFTv2.cpp see next line


sendCMD(0x29); /* Display on */


Why no display? I checked TFTv2.h Define statements and DDRD as well as PORTD are accurate
for Arduino Uno R3 and 2.8 TFT Touch Shield v2 pins according to eagle files code see next line


#define TFT_CS_LOW {DDRD |= 0x20;PORTD &=~ 0x20;}
#define TFT_CS_HIGH {DDRD |= 0x20;PORTD |= 0x20;}
#define TFT_DC_LOW {DDRD |= 0x40;PORTD &=~ 0x40;}
#define TFT_DC_HIGH {DDRD |= 0x40;PORTD |= 0x40;}
#define TFT_BL_OFF {DDRD |= 0x80;PORTD &=~ 0x80;}
#define TFT_BL_ON {DDRD |= 0x80;PORTD |= 0x80;}

#define XP A3
#define YP A2
#define XM A1
#define YM A0


after testing TFTv2.cpp with println(); code seems to play but no action “Why Huh”? please help get screen working thanks

Jim Shoffner
jimsathome:at:sbcglobal:dot:net
:at: = @
:dot: = .


If I get an answer you will to
good luck
Jim