earth sensor module - looking for an example for digital reading
-
Hello, the earth sensor has an digital and an analog output pin. All examples are focused on analog reading.
Can someone provide an example for digital reading? -
@herb Here you go:
https://github.com/m5stack/M5Stack/blob/master/examples/Unit/EARTH/EARTH.ino
Both analog and digital.
The earth sensor is rather...'simple'
from the docs page
https://docs.m5stack.com/en/unit/earth
you can see that the 'Ain' just reads the voltage across the sensor and the 'Din' is at least the threshold comparator, adjusted by the trim pot on back. -
@herb What are you hoping to achieve as Digital rating only provides a 1 or 0.
the only way to get values is through analogue and there is a project in the project zone of uiflow 2 found here https://uiflow2.m5stack.com/?pkey=3dd144a31f32480e9a7ed95461a9107a