0

I use a 2.8" TFT Touch Shield v1 and I want to read some data that were stred in sd and plot them with the tft.

When the following code is ordered, to access the data. TFT freezes.... but the code's execution is continued...

    pinMode(SS, OUTPUT);
    // see if the card is present and can be initialized:
    if (!SD.begin(chipSelect)) {
       Serial.println("Card failed, or not present");
    // don't do anything more:
       while (1) ;
    }

    Tempfile = SD.open("DATALOG.TXT",FILE_READ);
    if (! Tempfile) {
       Serial.println("error opening datalog.txt");
    // Wait forever since we cant write data
       while (1) ;}

I tested the code on the example of the tft graphics test... and the result was a freezed tft...

I tried also to run the example: tftbmp but the tft remains black. Once again the code is executed in the loop as i receive results from the Serial monitor but tft is black...

I use an Arduino Uno R3.

Any tip is welcomed

2 Answers 2

1

The solution to getting data from SD to TFT may depend on the type of data stored. See examples included in software for your TFT. Also it might be possible to solve this issue with 2 Arduinos using Software Serial, which, I believe, is included in the Arduino IDE. Assume you have stored analog data from a sensor on an SD. During the recording, you were able to visualize incoming data on your serial plotter and your sketch also allowed you to see the live data on your TFT. You now wish to visualize the data recorded on your SD on the TFT once more. To accomplish this with Software Serial, the SD card could be mounted on one Arduino and the TFT on another. The Tx and Rx pins of the 2 Arduinos must be connected as described in the Arduino Software Serial guide. This technique should allow user to "fool" the Arduino with TFT into thinking it is receiving live analog data from a sensor. Since the user has already written the sketch to visualize data from a sensor on TFT , the modifications should be easy.

0

old topic, but since I'm having the same issues I'll share what I found.

chipSelect is usually 10 for arduino uno, some exemples have other pin setted.

also I found a guy claiming he fixed his issues setting after

pinMode(SS, OUTPUT); digitalWrite(SS, HIGH);

1
  • chip select is 10 if Uno is SPI slave. if Uno is master 10 must be OUTPUT. that is way it is usually used as chip select for one of the SPI slaves. the SPI library sets the SS pin as OUTPUT and HIGH in begin()
    – Juraj
    Commented Apr 27, 2019 at 12:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.