I think my board might be bricked

I have an Arduino UNO board. Yesterday I made some modifications to my code and uploaded it to my board. Firstly it started spitting gibberish on the serial monitor even though the baud rate matched. I thought i would be able to fix this next morning.
Now I realize that even if I try to load new code onto it, even if it shows me that the upload is successful it doesn't seem to upload new code. So im stuck in a loop where I have code on it that doesn't work and i cant upload anything to it or reset it in order for it to work again.
Can anybody help me with this issue? Thanks!

If the upload is successful,it might be succesful...
Try a simple sketch like 'blink'.
Without anything connected to the board.
See if the builtin led blinks...

It says done uploading and it's still the same non functional program. It doesn't work.

What code did you use? What is connected? What uno board do you have?

This is the code im working on:

#include "DHT.h"
#include <LiquidCrystal.h>

#define DHTPIN 3       
#define DHTTYPE DHT11
#define sensorPower 2  

LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

DHT dht(DHTPIN, DHTTYPE);
unsigned long previousSensorMillis = 0;
unsigned long thlast = 0;
bool sensorState = false;
const long sensorInterval = 1000; // 1000ms = 1 sec
const long thInterval = 2000;
String msg = "Apasa pe Select";
String lastPrinted = msg;
int lcdstate = 0;

void setup() {
  Serial.begin(19200);
  dht.begin();
  pinMode(12, OUTPUT);
  pinMode(2, OUTPUT);
  digitalWrite(2, HIGH);
  lcd.begin(16, 2);
  lcd.clear();
  lcd.print(msg);
  delay(1000);
}
 







void loop() {
  
  
  unsigned long currentMillis = millis();

  
  if (currentMillis - previousSensorMillis >= sensorInterval) {
    previousSensorMillis = currentMillis;

    sensorState = !sensorState; // schimba starea senzorului
    digitalWrite(sensorPower, sensorState ? HIGH : LOW);
  }
  
  
  
  
  
  
  float h = dht.readHumidity();    // read humidity
  float t = dht.readTemperature(); // read temperature in °C
  int moisture = analogRead(A1);  // read soil moisture value
  int water = analogRead(A5);
  int light = analogRead(A2);
  int button = analogRead(A0);
  


  
  

if (!isnan(t) && !isnan(h)){

   Serial.print("Soil humidity: ");
    Serial.print(moisture);

  Serial.print(" Humidity: ");
  Serial.print(h);
  

  Serial.print(" Temperature: ");
  Serial.print(t-2);
  Serial.println(" °C");
}



 


  if (light >= 512 && light <= 1023)
  {

    



  }


if (moisture>500 || moisture<400){
    digitalWrite(12, HIGH);
  } else {
    digitalWrite(12, LOW);
  }





  


  

  if ( water<500) {
 


  }






  
if (msg == lastPrinted && (button == 640 || button == 641))
 {
  lcdstate = 1;
    

    
   
   ; 

  if (button == 101 || button == 102 || button == 259 || button == 258 ||
      button == 410 || button == 411 || button == 0 || button == 1022 || button == 1023) {
    lastPrinted = "ahgyadfiuah";
  }
if(currentMillis - thlast >= thInterval){
  thlast = currentMillis;
  
  
  float newH = dht.readHumidity();
  float newT = dht.readTemperature();

  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Temp");
  lcd.setCursor(0, 1);
  lcd.print(newT-2);
  lcd.setCursor(7, 0);
  lcd.print("Hum");
  lcd.setCursor(7, 1);
  lcd.print(newH);

  Serial.print("Soil humidity: ");
    Serial.print(moisture);

  Serial.print(" Humidity: ");
  Serial.print(h);
  

  Serial.print(" Temperature: ");
  Serial.print(t-2);
  Serial.println(" °C");

  delay(200);
   }


 }
 
  if (lcdstate == 1){
    if(currentMillis - thlast >= thInterval){
  thlast = currentMillis;
  
  
  float newH = dht.readHumidity();
  float newT = dht.readTemperature();

  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Temp");
  lcd.setCursor(0, 1);
  lcd.print(newT-2);
  lcd.setCursor(7, 0);
  lcd.print("Hum");
  lcd.setCursor(7, 1);
  lcd.print(newH);

  Serial.print("Soil humidity: ");
    Serial.print(moisture);

  Serial.print(" Humidity: ");
  Serial.print(h);
  

  Serial.print(" Temperature: ");
  Serial.print(t-2);
  Serial.println(" °C");


  }
 
  }
 
 
 
 
  if (msg != lastPrinted){

  }



  delay(100);
  
 
}




I only edited it so that the lcd temp and humidity value would change by 1 to display instead of every 2 seconds and it started giving me gibberish. I undo ed everything reverting it to this iteration that i pasted, and it still would do the same thing. Today I realised after i tried to upload a bare minimum sketch that it wont upload any code on it. Im using a clone R3.

As said: try the blink code...
Something really simple...
That will tell you if the board works...

I tried and it doesn't work.

What is 'it'?

Why is all your code 3 times the same?
Why is a variable containing humidity created 3 times?
And why is there so many empty lines?

Because i tried troubleshooting something and i forgot to delete them.

For using later

As build sez , disconnect everything , and load up blink - copy the upload messages and any errors and post here and tell us if it works .

then you will get a response about your board .

Also detail what board you have ( UNO from where ?) whether it has worked before .

How are uploading code ( usb ?)

as a general tip Always test your board first , then build up the code bit by bit and try as it goes - then you will find errors and the source .

You had another topic about upload problems (I can't upload to my Arduino UNO); did you solve that? If yes, how?

It might help if you give us the full error message that you get when you try to upload.

I suggest that you enable verify after upload under file → preferences if you haven't done so already.

Your topic has been moved to a more suitable location on the forum.

There are no errors it just says it works when it doesnt, I have everything disconnected. Im uploading code from usb and it's a clone UNO r3 that i got from a local tech store.

I didn't necessarily solve that issue, I just noticed that if i spam the upload button eventually it will upload. Again, I don't get any error message it just says it uploaded when it actually didn't.

Still not clear which 'blink' code you have tried to upload..

You seem to jump to conclusions.. that it uploaded but did not...
I think it did upload...
But we need to check that first (hence the blink sketch).
And after that find what may be wrong...

I tried upload the example sketch "blink" and it didn't work. I also had an lcd connected to the board to be sure if it actually uploaded or not because if it hadn't "Apasa pe Select" would be displayed and sure enough it was.

OK, you should solve that first. Why do you use Minicore and not the standard Uno upload.

Did you enable verify after upload? It performs an additional verification after the code is flashed and might pick up an issue that it is not flashed correctly.

I don't understand. If you see that message the upload did succeed, if you don't see that message upload failed.

You need to upload with NOTHING connected to the board , the blink sketch, using a USB lead .

You should be selecting UNO as your board , not anything else , then show us the result , the displayed messages on the computer screen .

Make sure you have verify set in the options .

It’s the only way we can be sure what’s happening and give advice. ( we don’t have your display or it’s connections , so remove everything , that’s everything)