int led = 13; int ldr; void setup() { pinMode(led, OUTPUT); Serial.begin(9600); } void loop() { ldr = analogRead(A2); if (ldr < 700) digitalWrite(led, 1); else digitalWrite(led, 0); Serial.println(ldr); }
byte LED = 3; void setup() { pinMode(LED, OUTPUT); } void loop() { analogWrite(LED, 255); delay(1000); analogWrite(LED, 128); delay(1000); analogWrite(LED, 64); delay(1000); analogWrite(LED, 0); delay(1000); }
No responses yet