I have currently got a 2.8 TFT LCD touch shield and i am using it with an arduino uno.
I am having problems getting the heart rate to display on the screen.
I am using the following;
-Grove finger clip heart rate sensor (Grove Finger-clip Heart Rate Sensor w/ Shell - RobotShop)
-2.8 ITDB02 Shield (http://www.robotshop.com/uk/arduino-tft-touch-shield.html)
I have created the following sketch can anyone see where i a have gone wrong?
#include <UTFT.h>
#include <Wire.h>
// Declare which fonts we will be using
extern uint8_t SmallFont[];
extern uint8_t BigFont[];
extern uint8_t SevenSegNumFont[];
UTFT myGLCD(ITDB28,A5,A4,A3,A2);
void setup()
{
randomSeed(analogRead(0));
// Setup the LCD
myGLCD.InitLCD();
myGLCD.setFont(SmallFont);
}
void loop()
{
int buf[318];
int x, x2;
int y, y2;
int r;
// Clear the screen and draw the frame
// myGLCD.clrScr();
myGLCD.setColor(255, 0, 0);
myGLCD.fillRect(0, 0, 319, 13);
myGLCD.setColor(64, 64, 64);
myGLCD.fillRect(0, 226, 319, 239);
myGLCD.setColor(255, 255, 255);
myGLCD.setBackColor(255, 0, 0);
myGLCD.print("* HEART RATE GLOVE *", CENTER, 1);
myGLCD.setBackColor(64, 64, 64);
myGLCD.setColor(255,255,0);
myGLCD.print("MADE BY EMMANUEL", CENTER, 227);
myGLCD.setColor(0, 0, 255);
myGLCD.drawRect(0, 14, 319, 225);
Wire.requestFrom(0xA0 >> 1, 1); // request 1 bytes from slave device
while (Wire.available()) // slave may send less than requested
{
unsigned char c = Wire.read(); // receive heart rate value (a byte)
Serial.println(c, DEC); // print heart rate value
myGLCD.setColor(VGA_WHITE);
myGLCD.setBackColor(0, 0, 0);
myGLCD.setFont(BigFont);
myGLCD.print(c, CENTER, 0);
}
delay(500);
}