Da gebe ich Euch natürlich Recht. Ich hätte mich vorher erkundigen sollen.
Ich habe das Display jetzt auf einem Mega2560 zum mit einem einfach Sketch zum laufen bekommen. Das war schon nicht einfach. Habe im Netz viel gesucht.
Wenn ich von das Display nur als Anzeige benutze und die Funktion des Touch und der SD Karte weg lasse, müsste ich doch mit weniger Pins auskommen? Sehe ich das richtig?
So wie es jetzt läuft, scheinen ja auch weniger Pins auf dem Mega benötigt zu werden ?
// UTFT_Demo_480x320
// Copyright (C)2015 Rinky-Dink Electronics, Henning Karlsen. All right reserved
// web: http://www.RinkyDinkElectronics.com/
//
// This program is a demo of how to use most of the functions
// of the library with a supported display modules.
//
// This demo was made for modules with a screen resolution
// of 480x320 pixels.
//
// This program requires the UTFT library.
//
//################################################
// GLUE class that implements the UTFT API
// replace UTFT include and constructor statements
// remove UTFT font declaration e.g. SmallFont
//################################################
#include <UTFTGLUE.h> //use GLUE class and constructor
UTFTGLUE myGLCD(0,A2,A1,A3,A4,A0); //all dummy args
#include <Adafruit_GFX.h> // Core graphics library
#include <MCUFRIEND_kbv.h> // Hardware-specific library
MCUFRIEND_kbv tft;
#include <Fonts/FreeSans9pt7b.h>
#include <Fonts/FreeSans12pt7b.h>
#include <Fonts/FreeSerif12pt7b.h>
#include <FreeDefaultFonts.h>
#define BLACK 0x0000
#define RED 0xF800
#define GREEN 0x07E0
#define WHITE 0xFFFF
#define GREY 0x8410
// Set the pins to the correct ones for your development shield
// ------------------------------------------------------------
// Arduino Uno / 2009:
// -------------------
// Standard Arduino Uno/2009 shield : <display model>,A5,A4,A3,A2
// DisplayModule Arduino Uno TFT shield : <display model>,A5,A4,A3,A2
//
// Arduino Mega:
// -------------------
// Standard Arduino Mega/Due shield : <display model>,38,39,40,41
// CTE TFT LCD/SD Shield for Arduino Mega : <display model>,38,39,40,41
//
// Remember to change the model parameter to suit your display module!
//UTFT myGLCD(CTE32HR,38,39,40,41);
int sch = 0;
void setup()
{
randomSeed(analogRead(0));
// Setup the LCD
myGLCD.InitLCD();
// myGLCD.setFont(BigFont);
Serial.begin(9600);
uint16_t ID = tft.readID();
if (ID == 0xD3) ID = 0x9481;
tft.begin(ID);
tft.setRotation(1);
tft.fillScreen(BLACK); //Clear the Screen
tft.setCursor(80, 80);
tft.setTextSize(3);
myGLCD.setColor(0, 0, 0);
tft.print("Thomas");
}
void loop()
{
if (sch >= 60)
{
sch = 0;
}
myGLCD.setColor(0, 0, 0);
myGLCD.fillRect(240, 80, 275, 100);
tft.setTextColor(WHITE);
tft.setCursor(240, 80);
tft.print(sch);
Serial.println(sch);
sch=sch+1; // sch+1 bei jedem Schleifendurchlauf
delay (1000);
}