Sie sind vermutlich noch nicht im Forum angemeldet - Klicken Sie hier um sich kostenlos anzumelden Impressum 
Sie können sich hier anmelden
Dieses Thema hat 21 Antworten
und wurde 8.650 mal aufgerufen
 Tipps & Tricks zum Modulbau
Seiten 1 | 2
Björn L Offline




Beiträge: 459

28.09.2020 13:59
Bushaltestelle Mit TFT Displays Zitat · Antworten

Hallo Zusammen,
ich möchte euch gerne eine Anleitung zum Bau einer Bushaltestelle mit TFT Displays geben.
Dafür habe ich eine Haltestelle im CAD gezeichnet, welche ausgedruckt werden kann.
Hier passen 2x 0,96 TFT Displays hinein.
Mit ein wenig Farbe und dünner Klarsichtfolie für die Fenster lässt sich die Haltestelle noch etwas aufpolieren. Aus dünnem Farbkarton habe ich noch Passepartouts für die Displays geschnitten.

Angesteuert wird das Ganze mit einem Arduino Mega und der UTFT Library.
Ich hoffe das das Video euch zum Nachbauen anregt...



Benötigte Elemente

- Download STL File Bushaltestelle
- Arduino Mega
- 2x 0.96 TFT Displays

Hier noch der Link für die Library
Link

----------------------------------------------------
Viele Grüße aus dem Norden

Björn


Folgende Mitglieder finden das Top: Noach, half_pig und xenton
Björn L Offline




Beiträge: 459

28.09.2020 14:03
#2 RE: Bushaltestelle Mit TFT Displays Zitat · Antworten

Hier noch der Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
 
#include <UTFT.h>
#include <avr/pgmspace.h>
 

// Initialize display
// Library only supports software SPI at this time
//NOTE: support DUE , MEGA , UNO
//SDI=11 SCL=13 /CS =10 /RST=8 D/C=9
UTFT myGLCD(ST7735S_4L_80160,11,13,10,8,9); //LCD: 4Line serial interface SDI SCL /CS /RST D/C NOTE:Only support DUE MEGA UNO
 
// Declare which fonts we will be using
 
//extern uint8_t BigFont[];
//extern uint8_t Font_blo[];
 
const unsigned short CocaCola_79x116[0x23CC] PROGMEM ={
0xB533, 0xB533, 0xB533, 0xB533, 0xBD54, 0xB533, 0xBD54, 0xBD54, 0xBD54, 0xBD54, 0xBD54, 0xBD54, 0xBD54, 0xBD55, 0xBD54, 0xBD74, // 0x0010 (16)
0xBD74, 0xBD74, 0xC595, 0xB513, 0xBD75, 0xBD75, 0xC5B6, 0xCDD6, 0xCDD6, 0xCDD6, 0xCDD6, 0xCDD6, 0xCDD7, 0xCDD7, 0xCDF7, 0xCDD7, // 0x0020 (32)
0xD5F7, 0xD5F7, 0xCDF7, 0xCDF7, 0xCDF7, 0xCE17, 0xCE17, 0xD617, 0xD617, 0xD617, 0xD637, 0xD637, 0xD637, 0xD637, 0xCE17, 0xD617, // 0x0030 (48)
0xD617, 0xCE17, 0xD638, 0xD638, 0xD638, 0xD638, 0xD638, 0xCE17, 0xD617, 0xD638, 0xCDF7, 0xBDB5, 0xD617, 0xCE17, 0xCE17, 0xD5F7, // 0x0040 (64)
0xD5F7, 0xD5F7, 0xCDF7, 0xCDF7, 0xCDD7, 0xCDD6, 0xC5D6, 0xC5D6, 0xC5D6, 0xC5D6, 0xC5D6, 0xC5B6, 0xC5B6, 0xC595, 0xC5B5, 0xB514, // 0x0050 (80)
 
//**************************************************************************************************************************************************************************************************
const unsigned short HM_79x116[0x23CC] PROGMEM ={
0xE6F9, 0xE6F9, 0xE6D9, 0xE6D9, 0xE6D9, 0xDEB9, 0xDE98, 0xDE98, 0xD677, 0xD657, 0xDE98, 0xE6B8, 0xDED9, 0xE6D9, 0xE6D9, 0xE6D9, // 0x0010 (16)
0xDEB9, 0xDEB9, 0xE6B9, 0xE6D9, 0xE6FA, 0xE6FA, 0xE6FA, 0xE6FA, 0xE6FA, 0xE6FA, 0xE71A, 0xE6FA, 0xEEF9, 0xDE57, 0xB4F1, 0xA44F, // 0x0020 (32)
0xCDB4, 0xD616, 0xD616, 0xCDF6, 0xCDF6, 0xE699, 0xEF3B, 0xEF3B, 0xE71A, 0xE6DA, 0xDEB9, 0xDE99, 0xDE98, 0xCE37, 0xCDF6, 0xC5D6, // 0x0030 (48)
0xC5F6, 0xCE17, 0xCE37, 0xE6D9, 0xF77C, 0xF77C, 0xF75C, 0xEF3B, 0xEF5C, 0xEF3B, 0xF75C, 0xF75C, 0xF75C, 0xF75C, 0xF75C, 0xF75C, // 0x0040 (64)
0xF77C, 0xF77C, 0xF77C, 0xF77C, 0xF77C, 0xF79D, 0xF79D, 0xFF9D, 0xFF9D, 0xFF9D, 0xFF9D, 0xFFBD, 0xF77C, 0xEF3B, 0xE6FA, 0xE6F9, // 0x0050 (80)
0xE6D9, 0xE6D9, 0xE6D9, 0xE6F9, 0xE6D9, 0xDEB9, 0xDE98, 0xDE98, 0xDE98, 0xE6B9, 0xE6D9, 0xE6D9, 0xE6D9, 0xE6FA, 0xE6F9, 0xE6F9, // 0x0060 (96)
0xE6D9, 0xE6F9, 0xE6FA, 0xE71A, 0xEF1A, 0xE71A, 0xE71A, 0xEF1A, 0xEF1A, 0xEF1A, 0xE6D9, 0xD636, 0xBD32, 0x9C0F, 0xA3EE, 0xB4B1, // 0x0070 (112)
0x9C0F, 0x93CE, 0x93CE, 0x93EE, 0x93EE, 0xBD33, 0xEEDA, 0xE6FA, 0xE6FA, 0xE6BA, 0xDEB9, 0xDE98, 0xD657, 0xCE16, 0xC5F6, 0xCE16, // 0x0080 (128)//
**************************************************************************************************************************************************************************************************
const unsigned short Astra_79x116[0x23CC] PROGMEM ={
0xF779, 0xF758, 0xF758, 0xF779, 0xF779, 0xF779, 0xF779, 0xF758, 0xEF17, 0xC5F5, 0x7BEF, 0xC658, 0x7C0F, 0x2102, 0x39A4, 0x49E5, // 0x0010 (16)
0x41E6, 0x94D1, 0xA512, 0x948F, 0xAD73, 0xAD74, 0xAD94, 0xAD94, 0xB5B5, 0xA511, 0xB5D5, 0xB5D5, 0xB5D5, 0xB5D5, 0xB5D5, 0xB573, // 0x0020 (32)
0xBDF5, 0xB5F5, 0xBDF6, 0xBDF6, 0xBDF6, 0xB593, 0xB593, 0xBDF6, 0xBDF5, 0xB5D5, 0xB5D5, 0xB5D5, 0xAD52, 0xB5B5, 0xADB4, 0xB594, // 0x0030 (48)
0xB595, 0xAD94, 0x9CD1, 0xAD53, 0xA553, 0xA553, 0xA533, 0xA533, 0xA552, 0x948F, 0x9D33, 0x9D32, 0x9D32, 0x9D12, 0x9D12, 0x8C4E, // 0x0040 (64)
0x9CF1, 0x9D11, 0x9D12, 0x94F2, 0x94F2, 0x94F1, 0x8C4F, 0x94D1, 0x94D1, 0x94D1, 0x94D1, 0x94B1, 0x844F, 0x73AC, 0x9CF2, 0xC5D2, // 0x0050 (80)
 
void setup() {

// Setup the LCD
myGLCD.InitLCD(PORTRAIT);
myGLCD.clrScr();
}
 
void loop() {
myGLCD.drawBitmap(0, 6, 79, 116, CocaCola_79x116); // Zeichnet ein Bitmap der Größe 35x35
myGLCD.setBackColor(VGA_BLACK);
delay(10000);
myGLCD.drawBitmap(0, 6, 79, 116, HM_79x116); // Zeichnet ein Bitmap der Größe 35x35
delay(10000);
myGLCD.drawBitmap(0, 6, 79, 116, Astra_79x116); // Zeichnet ein Bitmap der Größe 35x35
delay(10000);
}
 




Die Hexdaten sind leider nicht vollständig, da ich nicht soviel Text speichern kann.

----------------------------------------------------
Viele Grüße aus dem Norden

Björn


Björn L Offline




Beiträge: 459

28.09.2020 16:21
#3 RE: Bushaltestelle Mit TFT Displays Zitat · Antworten

Hier noch einmal der komplette Code als PDF, da die datei zu lang ist.

----------------------------------------------------
Viele Grüße aus dem Norden

Björn

Dateianlage:
Aufgrund eingeschränkter Benutzerrechte werden nur die Namen der Dateianhänge angezeigt Jetzt anmelden!
Code_Arduino.pdf

Theoretiker Offline




Beiträge: 2.340

28.09.2020 18:26
#4 RE: Bushaltestelle Mit TFT Displays Zitat · Antworten

Hallo Björn,
sehr schönes Projekt und genial umgesetzt.
Es sind die kleinen aber feinen Details die eine Modellanlage interessant machen.

Grüße Oliver

Videos, Tutorials, How to ...
Homepage: www.der-theoretiker.de
Youtube: www.youtube.com/user/Mikromodelle
Facebook: www.facebook.com/Mikromodellbau.theoretiker/


Mikromodellbauvirus Offline



Beiträge: 257

28.09.2020 22:34
#5 RE: Bushaltestelle Mit TFT Displays Zitat · Antworten

Gefällt mir sehr sehr gut.

Im Header steht dass der UNO auch unterstützt wird. Hast du da Erfahrungen oder reicht da etwa der Speicher nicht?

Gruß
Michael


Schau doch mal vorbei:
Die Modellbauer-Sulzbach-Rosenberg
http://die-modellbauer-su-ro.de/


Björn L Offline




Beiträge: 459

29.09.2020 08:55
#6 RE: Bushaltestelle Mit TFT Displays Zitat · Antworten

Hallo Oliver und Michael,
erst einmal danke für euer Lob.
Ich habe es mit dem Arduino Mini, Nano und Uno ausprobiert. Prinzipiell kann man alle benutzen.
Für diese Arduinos passt allerdings nur eine Grafik in den Speicher. Deswegen bin ich dann auf den Mega gegangen.
Ich habe zuhause das gleiche Display noch einmal mit einem SD-Karten Slot liegen. Da kann man dann die Bilder drauf speichern. Dafür wird allerdings eine andere Library benutzt. Das muss ich bei Gelegenheit mal ausprobieren...

----------------------------------------------------
Viele Grüße aus dem Norden

Björn


Björn L Offline




Beiträge: 459

08.11.2020 12:43
#7 RE: Bushaltestelle Mit TFT Displays Zitat · Antworten

Hallo Zusammen,
ich habe inzwischen mal das TFT Display mit integrierter SD Karte ausprobiert.
Die Darstellung ist genauso klasse. Leider zeigen die Fotos nie die wirkliche Qualität.
Für dieses Display wird allerdings eine andere Library verwendet. Die ST7735 Lib konnte man sich direkt nach dem Kauf beim chinesischen Verkäufer herunter laden.

Der Anschluss sieht so aus:

Display Arduino (Nano)
VCC ---- 5V
GND ---- GND
MOSI ---- D11
SCK ---- D13
DC ---- D8
TFTCS ---- D10
MISO ---- D12
SDCS ---- D10

Die Anschlüsse RST und LED werden nicht verwendet.
Die Anschlüsse DC, TFTCS und SDCS können frei gewählt werden, wenn sie entsprechend im Sketch definiert werden.

TFT_Display.jpg - Bild entfernt (keine Rechte)

Der Code dazu sieht dann so aus:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
 
/***************************************************
This is a library for the OPEN-MART 0.96INCH IPS TFT LCD using software SPI port
and the micro SD card module use hardware SPI port.
Modified by OPEN-SMART Team.

OPEN-MART 0.96INCH IPS TFT LCD
----> https://www.aliexpress.com/store/product/OPEN-SMART-0-96-inch-160-80-IPS-TFT-LCD-Display-with-MicroSD-Card-Socket-Breakout/1199788_32967177796.html?spm=2114.12010608.0.0.2ca348ecamDOIG
----> https://www.aliexpress.com/store/product/OPEN-SMART-3-3V-0-96-inch-160-80-IPS-TFT-LCD-Display-Breakout-Board-Module/1199788_32970036085.html?spm=a2g1y.12024536.productList_1552059.pic_1
OPEN-SMART UNO R3 Air:
----> https://www.aliexpress.com/store/product/UNO-R3-Air-ATMEGA328P-CH340-Development-Board-with-USB-Cable-for-Arduino-UNO-R3-Easy-Plug/1199788_32958196980.html?spm=2114.12010615.8148356.42.15401964msfbay
OPEN-SMART Micro SD Card Module:
----> https://www.aliexpress.com/store/product/Micro-SD-Card-Module-TF-Card-Reader-for-Arduino-RPi-AVR-SPI-Interface-3-3V-5V/1199788_32787679017.html?spm=2114.12010615.8148356.1.60032a9dumzoAf
This is a library for the Adafruit 1.8" SPI display.
 
This library works with the Adafruit 1.8" TFT Breakout w/SD card
----> http://www.adafruit.com/products/358
The 1.8" TFT shield
----> https://www.adafruit.com/product/802
The 1.44" TFT breakout
----> https://www.adafruit.com/product/2088
as well as Adafruit raw 1.8" TFT display
----> http://www.adafruit.com/products/618
 
Check out the links above for our tutorials and wiring diagrams
These displays use SPI to communicate, 4 or 5 pins are required to
interface (RST is optional)
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
 
Written by Limor Fried/Ladyada for Adafruit Industries.
MIT license, all text above must be included in any redistribution
****************************************************/
 
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library for ST7735
#include <Adafruit_ST7789.h> // Hardware-specific library for ST7789
#include <SPI.h>
#include <SD.h>
 
#define SD_CS 4 // Chip select line for SD card
// TFT display and SD card will share the hardware SPI interface.
// Hardware SPI pins are specific to the Arduino board type and
// cannot be remapped to alternate pins. For Arduino Uno,
// Duemilanove, etc., pin 11 = MOSI, pin 12 = MISO, pin 13 = SCK.
#define TFT_RST -1 //If you use OPEN-SMART IPS TFT with Auto-reset IC onboard, you can set to -1 and do not need connect RST pin.
//Or set to -1 and connect to Arduino RESET pin
#define TFT_CS 10 // Chip select line for TFT display
#define TFT_DC 8 // Data/command line for TFT
 
// Option 1 (recommended): must use the hardware SPI pins
// (for UNO thats SCLK = 13 and SDA = 11) and pin 10 must be
// an output. This is much faster
// For 0.96", 1.44" and 1.8" TFT with ST7735 use
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);
 
// Option 2: use any pins but a little slower!
//#define TFT_SCLK A2 // set these to be whatever pins you like!
//#define TFT_MOSI A3 // set these to be whatever pins you like!
//Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);
 
void setup(void) {
Serial.begin(9600);
 
while (!Serial) {
delay(10); // wait for serial console
}
 
pinMode(TFT_CS, OUTPUT);
digitalWrite(TFT_CS, HIGH);
pinMode(SD_CS, OUTPUT);
digitalWrite(SD_CS, HIGH);
 
// Use this initializer if you're using a 1.8" TFT
//tft.initR(INITR_BLACKTAB);
 
// Use this initializer (uncomment) if you're using a 1.44" TFT
//tft.initR(INITR_144GREENTAB);
 
// Use this initializer (uncomment) if you're using a 0.96" 180x60 TFT
tft.initR(INITR_MINI160x80); // initialize a ST7735S chip, mini display
 
// Use this initializer (uncomment) if you're using a 1.54" 240x240 TFT
// tft.init(240, 240); // initialize a ST7789 chip, 240x240 pixels
tft.invertDisplay(true);
tft.fillScreen(ST77XX_BLUE);
 
Serial.print("Initializing SD card...");
if (!SD.begin(SD_CS)) {
Serial.println("failed!");
return;
}
Serial.println("OK!");
 
File root = SD.open("/");
printDirectory(root, 0);
root.close();
tft.setRotation(1);
 
}
 
void loop() {
 
bmpDraw("BMW1.bmp", 0, 0);
delay(5000);
tft.fillScreen(ST77XX_BLACK);
bmpDraw("BMW2.bmp", 0, 0);
delay(5000);
tft.fillScreen(ST77XX_BLACK);
bmpDraw("BMW3.bmp", 0, 0);
delay(5000);
tft.fillScreen(ST77XX_BLACK);
bmpDraw("BMW4.bmp", 0, 0);
// wait 5 seconds
delay(5000);
 
}
 
// This function opens a Windows Bitmap (BMP) file and
// displays it at the given coordinates. It's sped up
// by reading many pixels worth of data at a time
// (rather than pixel by pixel). Increasing the buffer
// size takes more of the Arduino's precious RAM but
// makes loading a little faster. 20 pixels seems a
// good balance.
 
#define BUFFPIXEL 20
 
void bmpDraw(char *filename, uint8_t x, uint16_t y) {
 
File bmpFile;
int bmpWidth, bmpHeight; // W+H in pixels
uint8_t bmpDepth; // Bit depth (currently must be 24)
uint32_t bmpImageoffset; // Start of image data in file
uint32_t rowSize; // Not always = bmpWidth; may have padding
uint8_t sdbuffer[3*BUFFPIXEL]; // pixel buffer (R+G+B per pixel)
uint8_t buffidx = sizeof(sdbuffer); // Current position in sdbuffer
boolean goodBmp = false; // Set to true on valid header parse
boolean flip = true; // BMP is stored bottom-to-top
int w, h, row, col;
uint8_t r, g, b;
uint32_t pos = 0, startTime = millis();
 
if((x >= tft.width()) || (y >= tft.height())) return;
 
Serial.println();
Serial.print(F("Loading image '"));
Serial.print(filename);
Serial.println('\'');
 
// Open requested file on SD card
if ((bmpFile = SD.open(filename)) == NULL) {
Serial.print(F("File not found"));
return;
}
 
// Parse BMP header
if(read16(bmpFile) == 0x4D42) { // BMP signature
Serial.print(F("File size: ")); Serial.println(read32(bmpFile));
(void)read32(bmpFile); // Read & ignore creator bytes
bmpImageoffset = read32(bmpFile); // Start of image data
Serial.print(F("Image Offset: ")); Serial.println(bmpImageoffset, DEC);
// Read DIB header
Serial.print(F("Header size: ")); Serial.println(read32(bmpFile));
bmpWidth = read32(bmpFile);
bmpHeight = read32(bmpFile);
if(read16(bmpFile) == 1) { // # planes -- must be '1'
bmpDepth = read16(bmpFile); // bits per pixel
Serial.print(F("Bit Depth: ")); Serial.println(bmpDepth);
if((bmpDepth == 24) && (read32(bmpFile) == 0)) { // 0 = uncompressed
 
goodBmp = true; // Supported BMP format -- proceed!
Serial.print(F("Image size: "));
Serial.print(bmpWidth);
Serial.print('x');
Serial.println(bmpHeight);
 
// BMP rows are padded (if needed) to 4-byte boundary
rowSize = (bmpWidth * 3 + 3) & ~3;
 
// If bmpHeight is negative, image is in top-down order.
// This is not canon but has been observed in the wild.
if(bmpHeight < 0) {
bmpHeight = -bmpHeight;
flip = false;
}
 
// Crop area to be loaded
w = bmpWidth;
h = bmpHeight;
if((x+w-1) >= tft.width()) w = tft.width() - x;
if((y+h-1) >= tft.height()) h = tft.height() - y;
 
// Set TFT address window to clipped image bounds
tft.startWrite();
tft.setAddrWindow(x, y, w, h);
 
for (row=0; row<h; row++) { // For each scanline...
 
// Seek to start of scan line. It might seem labor-
// intensive to be doing this on every line, but this
// method covers a lot of gritty details like cropping
// and scanline padding. Also, the seek only takes
// place if the file position actually needs to change
// (avoids a lot of cluster math in SD library).
if(flip) // Bitmap is stored bottom-to-top order (normal BMP)
pos = bmpImageoffset + (bmpHeight - 1 - row) * rowSize;
else // Bitmap is stored top-to-bottom
pos = bmpImageoffset + row * rowSize;
if(bmpFile.position() != pos) { // Need seek?
tft.endWrite();
bmpFile.seek(pos);
buffidx = sizeof(sdbuffer); // Force buffer reload
}
 
for (col=0; col<w; col++) { // For each pixel...
// Time to read more pixel data?
if (buffidx >= sizeof(sdbuffer)) { // Indeed
bmpFile.read(sdbuffer, sizeof(sdbuffer));
buffidx = 0; // Set index to beginning
tft.startWrite();
}
 
// Convert pixel from BMP to TFT format, push to display
b = sdbuffer[buffidx++];
g = sdbuffer[buffidx++];
r = sdbuffer[buffidx++];
tft.pushColor(tft.color565(r,g,b));
} // end pixel
} // end scanline
tft.endWrite();
Serial.print(F("Loaded in "));
Serial.print(millis() - startTime);
Serial.println(" ms");
} // end goodBmp
}
}
 
bmpFile.close();
if(!goodBmp) Serial.println(F("BMP format not recognized."));
}
 

// These read 16- and 32-bit types from the SD card file.
// BMP data is stored little-endian, Arduino is little-endian too.
// May need to reverse subscript order if porting elsewhere.
 
uint16_t read16(File f) {
uint16_t result;
((uint8_t *)&result)[0] = f.read(); // LSB
((uint8_t *)&result)[1] = f.read(); // MSB
return result;
}
 
uint32_t read32(File f) {
uint32_t result;
((uint8_t *)&result)[0] = f.read(); // LSB
((uint8_t *)&result)[1] = f.read();
((uint8_t *)&result)[2] = f.read();
((uint8_t *)&result)[3] = f.read(); // MSB
return result;
}
 

void printDirectory(File dir, int numTabs) {
while (true) {
 
File entry = dir.openNextFile();
if (! entry) {
// no more files
break;
}
for (uint8_t i = 0; i < numTabs; i++) {
Serial.print('\t');
}
Serial.print(entry.name());
if (entry.isDirectory()) {
Serial.println("/");
printDirectory(entry, numTabs + 1);
} else {
// files have sizes, directories do not
Serial.print("\t\t");
Serial.println(entry.size(), DEC);
}
entry.close();
}
}
 

----------------------------------------------------
Viele Grüße aus dem Norden

Björn

https://www.youtube.com/channel/UCS-QU-plI0K0gqP8ssFMyJA


Folgende Mitglieder finden das Top: TT Niklas, Theoretiker und nachtdieb
TT Niklas, Theoretiker und nachtdieb haben sich bedankt!
Selbstfeiermeister Offline




Beiträge: 1.814

08.11.2020 13:31
#8 RE: Bushaltestelle Mit TFT Displays Zitat · Antworten

Super! Danke, für den Code!

Gruß
Sebastian

https://www.shapeways.com/shops/sebastians-shapeways-shop


Folgende Mitglieder finden das Top: Björn L und TT Niklas
TT Niklas hat sich bedankt!
Björn L Offline




Beiträge: 459

08.11.2020 14:05
#9 RE: Bushaltestelle Mit TFT Displays Zitat · Antworten

Ach ja, die Bilder müssen mit der Auflösung 160x80 in der Farbtiefe 24 direkt ohne Ordner Struktur als .bmp auf die SD Karte gespeichert werden.

Gruß Björn

----------------------------------------------------
Viele Grüße aus dem Norden

Björn

https://www.youtube.com/channel/UCS-QU-plI0K0gqP8ssFMyJA


Folgende Mitglieder finden das Top: Blaze, TT Niklas, Theoretiker und nachtdieb
TT Niklas und Theoretiker haben sich bedankt!
Björn L Offline




Beiträge: 459

09.11.2020 11:22
#10 RE: Bushaltestelle Mit TFT Displays Zitat · Antworten

Ich habe auch noch einmal die Library für die Displays mit SD-Karte angehängt.

----------------------------------------------------
Viele Grüße aus dem Norden

Björn

https://www.youtube.com/channel/UCS-QU-plI0K0gqP8ssFMyJA

Dateianlage:
Aufgrund eingeschränkter Benutzerrechte werden nur die Namen der Dateianhänge angezeigt Jetzt anmelden!
[OPEN-SMART] 0.96INCH IPS TFT LCD with SD After date of 20191210.zip

Folgende Mitglieder finden das Top: TT Niklas, Theoretiker, nachtdieb und Maik_29413
TT Niklas, Theoretiker, nachtdieb und Maik_29413 haben sich bedankt!
Björn L Offline




Beiträge: 459

18.01.2021 09:50
#11 RE: Bushaltestelle Mit TFT Displays Zitat · Antworten

Moin Zusammen,
im Beitrag #7 hat sich leider der Fehlerteufel eingeschlichen.

Die Verkabelung des SDCS Anschlusses wird mit dem D4 Eingang vom Arduino verbunden, da ich das so im Code definiert hatte.

----------------------------------------------------
Viele Grüße aus dem Norden

Björn

https://www.youtube.com/channel/UCS-QU-plI0K0gqP8ssFMyJA


lightning mcqueen Offline



Beiträge: 21

14.06.2021 21:48
#12 RE: Bushaltestelle Mit TFT Displays Zitat · Antworten

Hallo Björn,

zuerst einmal vielen Dank für die Bereitstellung des Codes.

Nun zu meiner Frage, grundsätzlich funktioniert das ganze, Verkabelung sollte richtig sein, nur kommen die Bilder alle als Negativ Bild. Woran könnte das liegen? habe nun schon das 3. Display probiert überall das gleiche Bild.
Kennst Du das Problem oder kannst du da helfen?

Viele Grüße aus Dresden

Daniel


Selbstfeiermeister Offline




Beiträge: 1.814

15.06.2021 01:07
#13 RE: Bushaltestelle Mit TFT Displays Zitat · Antworten

Vielleicht verwendest du ein anderes Display. Versuch doch einfach mal Zeile 85 auf "False" zu setzen (insofern du ein 1.54"-Display mit 240x240 verwendest und auch initialisierst). Du hast aber schon die Optionen, die du nicht verwendest auskommentiert, bzw. für die verwendeten die Auskommentierung entfernt?

Gruß
Sebastian

https://www.shapeways.com/shops/sebastians-shapeways-shop


Björn L Offline




Beiträge: 459

15.06.2021 09:08
#14 RE: Bushaltestelle Mit TFT Displays Zitat · Antworten

Moin lightning,
welches Display versuchst du gerade zum laufen zu bringen.
Mit oder ohne SD Karte. Von welchem Hersteller hast du die Displays gekauft?

----------------------------------------------------
Viele Grüße aus dem Norden

Björn

https://www.youtube.com/channel/UCS-QU-plI0K0gqP8ssFMyJA


lightning mcqueen Offline



Beiträge: 21

15.06.2021 14:11
#15 RE: Bushaltestelle Mit TFT Displays Zitat · Antworten

Ich versuche eines ohne SD Karte
TECNOIOT 0.96 inch 7P SPI HD TFT ST7735 Drive IC 80 * 160 65K Full Color IPS LCD
zum laufen zu bringen.

Viele Grüße aus Dresden

Daniel


Seiten 1 | 2
 Sprung  

disconnected Mikromodell-Chat Mitglieder Online 5
Xobor Xobor Community Software
Datenschutz