Error Exit Status 1 and Server Not Responding for Photodiode and LEDs

Hello and thank you for your help in advance! I am working on a project in the USA with an Arduino Nano in which the a photodiode (http://www.ti.com/product/OPT101/description) is supposed to trigger a cascade of 8 flashing LEDs when a flashlight is shined upon it. I am receiving an Error Status 1 and the Console states that the programmer is not responding even though the ON light on the Arduino remains on. I have already set my console to show verbose output.

/*

*/
// constant variables
const int green_cone = 13;
const int green_rod = 12;
const int blue_horizontal = 11;
const int yellow_bipolar2 = 10;
const int yellow_bipolar1 = 9;
const int red_ganglion1 = 8;
const int pink_amacrine = 7;
const int red_ganglion2 = 6;
const int photodiode = A0;

//changing variables
int photodiodeValue = 0;           //variable for reading photodiode value

// the setup routine runs once when you press reset:

void setup() {               
  // initialize the digital LED pins as an output:
pinMode(green_cone, OUTPUT);
pinMode(green_rod, OUTPUT);
pinMode(blue_horizontal, OUTPUT); 
pinMode(pink_amacrine, OUTPUT);
pinMode(yellow_bipolar1, OUTPUT);
pinMode(yellow_bipolar2, OUTPUT);
pinMode(red_ganglion1, OUTPUT);
pinMode(red_ganglion2, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
  photodiodeValue = analogRead(photodiode);                     // Read voltage value ranging from 0 -1023                        // read voltage value from serial monitor
if(photodiodeValue > 900){  
 
 //begin LED cascade
  //cone row
digitalWrite(green_cone, HIGH);   // turn the led on (HIGH is the voltage level)
delay(500);               // wait for five second
digitalWrite(green_cone, LOW);    // turn the led off by making the voltage LOW
delay(200); 

digitalWrite(blue_horizontal, HIGH);
delay(500);
digitalWrite(blue_horizontal, LOW);
delay(200);// wait for 2 second

digitalWrite(yellow_bipolar1, HIGH);
delay(500);
digitalWrite(yellow_bipolar1, LOW);
delay(200);

digitalWrite(red_ganglion1, HIGH);
delay(500);
digitalWrite(red_ganglion1, LOW);
delay(200);

//rod row
digitalWrite(green_rod, HIGH);
delay(500);
digitalWrite(green_rod, LOW);
delay(200);

digitalWrite(yellow_bipolar2, HIGH);
delay(500);
digitalWrite(yellow_bipolar2, LOW);
delay(200);

digitalWrite(pink_amacrine, HIGH);
delay(500);
digitalWrite(pink_amacrine, LOW);
delay(200);

digitalWrite(red_ganglion2, HIGH);
delay(500);
digitalWrite(red_ganglion2, LOW);
delay(200);}

else{
  //LEDs are off
  //cone row
digitalWrite(green_cone, LOW);    // turn the led off by making the voltage LOW
digitalWrite(blue_horizontal, LOW);
digitalWrite(yellow_bipolar1, LOW);
digitalWrite(red_ganglion1, LOW);

//rod row
digitalWrite(green_rod, LOW);
digitalWrite(yellow_bipolar2, LOW);
digitalWrite(pink_amacrine, LOW);
digitalWrite(red_ganglion2, LOW);
}}

Hi, and welcome to the forum.

Console?
Compiles without problems in the Arduino IDE.
Please you post the error message.
Leo..

Are you saying that sketch upload is not working? Have you tried uploading one of the example sketches
like Blink?

You have selected the right board?

You have selected the right serial port?

Thank you for your help! I am using a Macbook Air. Our current prototype is based off of a breadboard and we have checked that all connections are correct. The other day I was able to run the sketch with a high sensitivity value and as soon as I switched it to a low sensitivity value and uploaded the code I received the Exit status 1 error message. I have tried using a different USB cord but that didn't make a difference. Do you think its a hardware issue as opposed to the software? In other words, does my code look flaw-free?

The other day I was able to run the sketch with a high sensitivity value

What does this mean? What gets switched?

as soon as I switched it to a low sensitivity value and uploaded the code I received the Exit status 1 error message

Uploading code is not dependent on the actual code. Something must have changed with the hardware.

Just what are you trying to do?
Please post a schematic and photograph of your wiring.

So when I switched the photodiode to high sensitivity, I mean to say that I changed the conditional statement to say </if(photodiodeValue>100)> as opposed to a higher value creating low sensitivity of the photodiode value to be activated only by bright light such that </if(photodiodeValue>1000)>.

So when I switched the photodiode to high sensitivity, I mean to say that I changed the conditional statement to say </if(photodiodeValue>100)>

OK that is clear, however when coupled with the statement:-

The other day I was able to run the sketch with a high sensitivity value and as soon as I switched it to a low sensitivity value and uploaded the code I received the Exit status 1 error message.

Makes little sense. However their might be an explanation because a low sensitivity value might involve more LEDs being on. As you have no resistors in series with the LEDs this might trigger too much current being drawn from the USB.

Now you are going to say that you have resistors, but the way you have wired them the bread board tracks short out the resistors. Damaging both the LEDs and the Arduino’s output.

Why have you wired four LEDs to sink current and the other four to source current?