SHARE
TWEET

Untitled

a guest Oct 21st, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #define LED 3
  2. #define LDR A0
  3.  
  4. bool ledState = false;
  5.  
  6. void setup() {
  7.   pinMode(LED, OUTPUT);
  8. }
  9.  
  10. void loop() {
  11.   int sensorValue = analogRead(LDR);
  12.   analogWrite(LED, map(sensorValue, 0, 1023, 0, 255));
  13. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top