int moisture = 0; int percentage = 0; void setup() { Serial.begin(9600); // serial monitor baud rate pinMode(A0, INPUT); // PinMode set, pin for moisture sensor } void loop() { moisture = analogRead(A0); // reading value percentage = map(moisture, 0, 1023, 0, 100); // changing to percent Serial.print("Moisture= "); Serial.print(percentage); // Print percentage Serial.println("%"); delay(1000); }