Hallo zusammen,
ich habe folgendes Problem, ich möchte mit einem Arduino eine Werbetafel aufbauen,aber den Sketch den ich habe
erzeugt nach einer weile nur noch Streifen auf den Display. /(Wobei der Text immer angezeigt wird. myScreen. print ( "Mike's Modellbahn" )
Es wäre schön, wenn jemand mein Problem nachvollziehen könnte und ggf. eine Tipp für mich hat.
Die Bilder sind auf 128*160 24Bit Auflösung, die SD-Karte hat 2Gb.
Bei weitern Fragen.... nicht zögern...
Danke für eure Hilfe.
Anbei den Sketch:
/*
This sketch was created for the DS Tech 1.8" TFT screen
(that uses the ST7735 driver) and the Arduino TFT library
In order to use the screen and the card reader together,
you must use hardware SPI, not software SPI
The pin breakout DS Tech 1.8" TFT screen is as follows:
VCC........5V
GND........GND
GND........
NC.........
NC.........
NC.........
CLK........13 (also called SCK)
SDA........11 (also called MOSI)
RS.........9 (also called DC)
RST........8 (also called RESET)
CS.........10
SD_MISO....12
SD_SCK.....13 (connected to screen CLK above)
SD_MOSI....11 (connected to screen MOSI above)
SD_CS......4
I soldered a four-pin header to the SD connections on
the DS Tech 1.8" TFT screen
The SD card must be 2G or less and formatted as FAT (FAT16)
To fit on the screen, all image files on the card must be pre-sized
to 160 by 128 pixels or less and must be 24-bit RGB BMPs
*/
#include <SPI.h> //.kbv must add these includes
#include <SD.h>
#include <TFT.h> // Arduino LCD library
#include <SoftReset.h>
// Set constants for the pins for the TFT display and SD card
#define CS 10
#define DC 9
#define RESET 8
#define SD_CS 4
// Create the TFT screen called myScreen
TFT myScreen = TFT(CS, DC, RESET);
// Create a picture unit called myPicture
PImage myPicture;
void setup() {
// Initialize the Serial object (for use with card reader)
Serial.begin(9600);
// Initialize the card reader
//pinMode(SD_CS, OUTPUT);
//digitalWrite(SD_CS, HIGH);
// The the next non-comment line replaces the more typical...
//myScreen.begin();
//myScreen.background(0, 0, 0);
// If your screen colours are off, try one of the following:
// If your TFT's plastic wrap has a Black Tab, use the following:
//myScreen.initR(INITR_BLACKTAB); // initialize a ST7735S chip, black tab
// If your TFT's plastic wrap has a Red Tab, use the following:
//myScreen.initR(INITR_REDTAB); // initialize a ST7735R chip, red tab
// If your TFT's plastic wrap has a Green Tab, use the following:
//myScreen.initR(INITR_GREENTAB); // initialize a ST7735R chip, green tab
// Or try
//myScreen.initG(); // initialize a ST7735R chip, green tab
// Initialize the screen
myScreen.initR(INITR_BLACKTAB);
// Set screen orientation (could be 1 or 3 for landscape)
myScreen.setRotation(3);
// Initialize the SD card reader
Serial.print("Initializing SD card...");
if (!SD.begin(SD_CS)) {
Serial.println("failed!");
return;
}
Serial.println("OK!");
}
void loop(void)
{
myScreen.background(0, 0, 0);
delay(500);
myScreen. setTextSize ( 1 ) ;
myScreen. setCursor ( 15 , 50 ) ;
myScreen. setTextColor (ST7735_GREEN) ;
myScreen. print ( "Mike's Modellbahn" ) ;
delay(5000);
myPicture = myScreen.loadImage("2.bmp");
myScreen.image(myPicture, 0, 0);
delay(1000);
myPicture = myScreen.loadImage("1.bmp");
myScreen.image(myPicture, 0, 0);
delay(1000);
myPicture = myScreen.loadImage("3.bmp");
myScreen.image(myPicture, 0, 0);
delay(1000);
myPicture = myScreen.loadImage("4.bmp");
myScreen.image(myPicture, 0, 0);
delay(1000);
// myScreen.background(0, 0, 0);
// myScreen. fillScreen (ST7735_BLACK) ;
// delay(1000);
// soft_restart();
}