Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. int sensor_pin = A0;
  2. int output_value ;
  3. void setup() {
  4.    Serial.begin(9600);
  5.    Serial.println("Reading From the Sensor ...");
  6.    delay(2000);
  7.    }
  8. void loop() {
  9.    output_value= analogRead(sensor_pin);
  10.    output_value = map(output_value,550,0,0,100);
  11.    Serial.print("Mositure : ");
  12.    Serial.print(output_value);
  13.    Serial.println("%");
  14.    delay(1000);
  15.    }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement