The following code works. I get an output in the console every second of "Hello" and then the analogValue of the photoresistor.
int greenLedPin = D1;
int yellowLedPin = D2;
int redLedPin = D3;
int lightSensorPin = A0;
int analogValue = 0;
void setup() {
Serial.begin(9600);
// pinMode(greenLedPin, OUTPUT);
// pinMode(yellowLedPin, OUTPUT);
// pinMode(redLedPin, OUTPUT);
}
void loop() {
analogValue = analogRead(lightSensorPin);
Serial.println("Hello.");
Serial.println(analogValue);
delay(1000);
// digitalWrite(greenLedPin, HIGH);
// digitalWrite(yellowLedPin, HIGH);
// digitalWrite(redLedPin, HIGH);
}
Now as soon as I uncomment the pinMode commands nothing shows up on the console.
int greenLedPin = D1;
int yellowLedPin = D2;
int redLedPin = D3;
int lightSensorPin = A0;
int analogValue = 0;
void setup() {
Serial.begin(9600);
pinMode(greenLedPin, OUTPUT);
pinMode(yellowLedPin, OUTPUT);
pinMode(redLedPin, OUTPUT);
}
void loop() {
analogValue = analogRead(lightSensorPin);
Serial.println("Hello.");
Serial.println(analogValue);
delay(1000);
// digitalWrite(greenLedPin, HIGH);
// digitalWrite(yellowLedPin, HIGH);
// digitalWrite(redLedPin, HIGH);
}
Any idea what might be going on?
