# Problem in uploading the code

**URL:** <https://forum.arduino.cc/t/problem-in-uploading-the-code/1144048>\
**Category:** Programming\
**Created:** [July 3, 2023, 6:33am UTC](https://forum.arduino.cc/t/problem-in-uploading-the-code/1144048 "2023-07-03T06:33:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ubaid12ur](https://avatars.discourse-cdn.com/v4/letter/u/e8c25b/32.png) [@ubaid12ur](https://forum.arduino.cc/u/ubaid12ur)\
**Post date:** [July 3, 2023, 6:33am UTC](https://forum.arduino.cc/t/problem-in-uploading-the-code/1144048/1 "2023-07-03T06:33:20Z")

</div>

I want to display this code on LED but it gives me too much errors

#include \<TFT\_eSPI.h\>  
#include \<RTClib.h\>

TFT\_eSPI tft = TFT\_eSPI(); // Create an instance of the TFT\_eSPI library

// File structure  
struct File {  
String name;  
bool isDirectory;  
};

// Array of example files  
File files[] = {  
{"File 1.txt", false},  
{"File 2.txt", false},  
{"Folder 1", true},  
{"Folder 2", true}  
};  
int numFiles = sizeof(files) / sizeof(files[0]);

// Current selected file index  
int currentFileIndex = 0;

// Initialize the real-time clock (RTC)  
RTC\_DS1307 rtc;

void setup() {  
tft.begin(); // Initialize the TFT display  
tft.setRotation(3); // Adjust rotation if needed  
tft.fillScreen(TFT\_BLACK);

rtc.begin();  
if (!rtc.isrunning()) {  
rtc.adjust(DateTime(F( **DATE** ), F( **TIME** )));  
}  
}

void drawDesktop() {  
tft.fillScreen(TFT\_BLACK);

// Draw file explorer  
tft.setTextColor(TFT\_WHITE);  
tft.setTextSize(2);  
tft.setCursor(0, 0);  
tft.println("File Explorer");  
tft.setTextSize(1);  
for (int i = 0; i \< numFiles; i++) {  
tft.setCursor(0, 24 + (i \* 16));  
tft.print(i == currentFileIndex ? "\> " : " ");  
tft.println(files[i].name);  
}

// Draw clock  
DateTime now = rtc.now();  
tft.setTextSize(2);  
tft.setCursor(0, 200);  
tft.print("Time: ");  
tft.print(now.hour());  
tft.print(":");  
tft.print(now.minute());  
tft.print(":");  
tft.println(now.second());

tft.updateScreen();  
}

void loop() {  
// Update the desktop  
drawDesktop();

// Simulate a button press for demonstration  
if (millis() % 5000 \< 2500) {  
currentFileIndex++;  
if (currentFileIndex \>= numFiles) {  
currentFileIndex = 0;  
}  
}

// Delay for stability  
delay(100);  
}

---

<div class="post-metadata">

**Author:** ![pert](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/pert/32/217111_2.png) [@pert](https://forum.arduino.cc/u/pert)\
**Post date:** [July 3, 2023, 6:36am UTC](https://forum.arduino.cc/t/problem-in-uploading-the-code/1144048/2 "2023-07-03T06:36:14Z")

</div>

I moved your topic to an appropriate forum category @ubaid12ur .

In the future, please take some time to pick the [forum category](https://forum.arduino.cc/categories) that best suits the subject of your topic. There is an " **About the \_\_\_\_\_ category**" topic at the top of each category that explains its purpose.

This is an important part of responsible forum usage, as explained in [the " **How to get the best out of this forum**" guide](https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum/679966). The guide contains a lot of other useful information. Please read it.

This is the second time I had to ask you to do this. Please start being more respectful of our community here.

Thanks in advance for your cooperation.

---

<div class="post-metadata">

**Author:** ![ubaid12ur](https://avatars.discourse-cdn.com/v4/letter/u/e8c25b/32.png) [@ubaid12ur](https://forum.arduino.cc/u/ubaid12ur)\
**Post date:** [July 3, 2023, 6:38am UTC](https://forum.arduino.cc/t/problem-in-uploading-the-code/1144048/3 "2023-07-03T06:38:58Z")

</div>

Actually I want to make a project with a touch screen, I want to make a desktop, a clock in it and also a file explorer in it. and I want to install this mini program in arduino board

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [July 3, 2023, 6:40am UTC](https://forum.arduino.cc/t/problem-in-uploading-the-code/1144048/4 "2023-07-03T06:40:48Z")

</div>

> [@ubaid12ur](#):
>
> this code

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'  
  
Use [color = red] **code tags** [/color] (the \< CODE/ \> icon above the compose window)&nbsp;to make it easier to read and copy for examination   
  
[https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum](https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum)

---

<div class="post-metadata">

**Author:** ![ubaid12ur](https://avatars.discourse-cdn.com/v4/letter/u/e8c25b/32.png) [@ubaid12ur](https://forum.arduino.cc/u/ubaid12ur)\
**Post date:** [July 3, 2023, 6:42am UTC](https://forum.arduino.cc/t/problem-in-uploading-the-code/1144048/5 "2023-07-03T06:42:58Z")

</div>

thanks

---

<div class="post-metadata">

**Author:** ![anon56112670](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@anon56112670](https://forum.arduino.cc/u/anon56112670)\
**Post date:** [July 3, 2023, 6:58am UTC](https://forum.arduino.cc/t/problem-in-uploading-the-code/1144048/6 "2023-07-03T06:58:39Z")

</div>

> [@ubaid12ur](#):
>
> it gives me too much errors

And post those too.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [December 30, 2023, 6:59am UTC](https://forum.arduino.cc/t/problem-in-uploading-the-code/1144048/7 "2023-12-30T06:59:28Z")

</div>

Closed on December 30, 2023, 6:59am UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
