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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login