lorenzo_cesaretti

Fotoresistenza Arduino Led frequenza

Apr 13th, 2021
810
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int analogInPin = A0;
  2. int sensorValue = 0;
  3. int ledR = 5;
  4. void setup() {
  5.   Serial.begin(9600);
  6.   pinMode( analogInPin, INPUT);
  7.   pinMode (ledR, OUTPUT);
  8. }
  9.  
  10. void loop() {
  11.   sensorValue = analogRead(analogInPin);  
  12.   digitalWrite(ledR,HIGH);
  13.   delay(sensorvalue);
  14.   digitalWrite(ledR,LOW);
  15.   Serial.print("sensor = " );
  16.   Serial.println(sensorValue);      
  17.  
  18.   delay(1000);
  19. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×