Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // YL-69 Moisture sensor (Analog)
- #define SensorPin A0
- float sensorValue = 0;
- void setup() {
- Serial.begin(9600);
- }
- void loop() {
- for (int i = 0; i <= 100; i++)
- {
- sensorValue = sensorValue + analogRead(SensorPin);
- delay(1);
- }
- sensorValue = sensorValue / 100.0;
- Serial.println(sensorValue);
- delay(30);
- }
Advertisement
Add Comment
Please, Sign In to add comment