Hello!
I have a analog moister sensor, how do I make it work? How can I read the proper values from pin A0. I have a CR2032 battery. And i think the sensor can run on 3,3V
function onTimer() {
// Get the soil moister as a string
var h = analogRead(A0);
// Clear display
g.clear();
// Use the small font for a title
g.setFontBitmap();
g.drawString("Soil moister:");
// Use a large font for the value itself
g.setFontVector(30);
g.drawString(h, (g.getWidth()-g.stringWidth(h))/2,10);
// Update the screen
g.flip();
}
// Update soil moister every 2 seconds
setInterval(onTimer,2000);
// Update soil moister immediately
onTimer();
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hello!
I have a analog moister sensor, how do I make it work? How can I read the proper values from pin A0. I have a CR2032 battery. And i think the sensor can run on 3,3V
2 Attachments