Robotics & Arduino
Lesson 2 · Refinement

Watch the readings.

Tools → Serial Monitor. Set it to 9600 baud.

Here is the code — now you can copy and paste.

// DECLARE
const int LDR_PIN = A0;

// INIT
void setup() {
  Serial.begin(9600);
  pinMode(LDR_PIN, INPUT);
}

// RUN
void loop() {
  int ldrValue = analogRead(LDR_PIN);

  Serial.print("Light Level: ");
  Serial.println(ldrValue);

  delay(500);
}

// LOGIC
// Nothing here yet.

Light. Dark. No change. Why?