You are reading a single comment by @furuskog and its replies. Click here to read the full conversation.
  • 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();
    

    2 Attachments

    • Bild 2018-05-29 kl. 22.08.jpg
    • Bild 2018-05-29 kl. 22.10.jpg
About

Avatar for furuskog @furuskog started