const int PIN_LDR_ANALOG = A0;
const int PIN_LDR_DIGITAL = 2;
void setup()
{
Serial.begin(9600);
pinMode(PIN_LDR_DIGITAL, INPUT);
}
void loop()
{
int nilaiLDRAnalog = analogRead(PIN_LDR_ANALOG);
int nilaiLDRDigital = digitalRead(PIN_LDR_DIGITAL);
Serial.print("Digital: ");
Serial.print(nilaiLDRDigital);
Serial.print(" - Analog: ");
Serial.println(nilaiLDRAnalog);
}