Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://imgur.com/a/2eNBr5R
- const int analogIn = A1; // Connect the humidity sensor to this pin
- int humiditySensorOutput = 0;
- void setup()
- {
- Serial.begin(9600);
- }
- void loop()
- {
- humiditySensorOutput = analogRead(analogIn);
- int humidityPercentage = map(humiditySensorOutput, 0, 1023, 10, 70);
- Serial.print("Humidity: "); // Printing out Humidity Percentage
- Serial.print(humidityPercentage);
- Serial.println("%");
- delay(5000); // Iterate every 5 seconds
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement