Can't upload, no error description

For the past few days, I’ve been trying to upload my code to an Arduino Uno via the IDE (v. 1.8.7), but every time I try it just says “An error occurred while uploading the sketch”. No other details, just that one line. I’ve tried restarting the computer, reinstalling the IDE, switching ports, using a different board and cable, using a different computer, and writing the code from scratch. Nothing has worked. I also can’t upload any other sketches after attempting to do it with this one, with the same error. I have no idea what to do.

#include <Wire.h>
#include “Adafruit_TCS34725.h”

int c1 = 0;
int c2 = 1;
int c3 = 2;

Adafruit_TCS34725 tcs = Adafruit_TCS34725(TCS34725_INTEGRATIONTIME_50MS, TCS34725_GAIN_1X);

void setup() {

Serial.begin(9600);

pinMode(c1, OUTPUT);
pinMode(c2, OUTPUT);
pinMode(c3, OUTPUT);

}

void loop() {

setSensor(c1);

uint16_t r, g, b, c;

tcs.getRawData(&r, &g, &b, &c);

r = map(r, 0, 1400, 0, 255);
g = map(g, 0, 1400, 0, 255);
b = map(b, 0, 1400, 0, 255);

Serial.print("R: “); Serial.print(r, DEC); Serial.print(” ");
Serial.print("G: “); Serial.print(g, DEC); Serial.print(” ");
Serial.print("B: “); Serial.print(b, DEC); Serial.print(” ");

color(r, g, b);

Serial.println(" ");

}

/---------------------------------------------------/

void color(int r, int g, int b) {

if(r<140) {
if(g<100 && b<90) {
Serial.print(“Black”);
} else {
Serial.print(“Blue”);
}
}

else if(r>140 && r<205) {
Serial.print(“Green”);
}

else if(r>205 && r<280) {
Serial.print(“Red”);
}

else if(r>280 && r<320) {
if(g<205) {
Serial.print(“Orange”);
} else {
Serial.print(“Yellow”);
}
}

else {
Serial.print(“White”);
}
}

/--------------------------------------------------/

void setSensor(int sensor) {

if(sensor == 0) {
digitalWrite(c2, LOW);
digitalWrite(c3, LOW);
}

if(sensor == 1) {
digitalWrite(c1, LOW);
digitalWrite(c3, LOW);
}

if(sensor == 2) {
digitalWrite(c1, LOW);
digitalWrite(c2, LOW);
}

digitalWrite(sensor, HIGH);
}

Note: The libraries and everything worked before, with a simple test, but because I can’t upload anything now I can’t even get back to that.

Please do this:

  • File > Preferences > Show verbose output during: > compilation (uncheck) > upload (check) > OK
  • Sketch > Upload
  • After the upload fails you’ll see a button on the right side of the orange bar “Copy error messages”. Click that button.
  • Paste the error messages in a reply here USING CODE TAGS (</> button on the forum toolbar).