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);
}}