Good news!
Even got it work on a esp32 with espruino Here is the code
var high = 0.5; var low = 0.0; function map_value(val, in_min, in_max, out_min, out_max){ var result = (val - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; if(result < out_min) { return out_min; } else if(result > out_max) { return out_max; } return result; } function onTimer() { var h = analogRead(D35); // D35 is a adc-port (analog to digital converter) var hp = map_value(h, low, high, 0, 100); var percentage = hp.toFixed(0)+"%"; console.log("Soil moister", percentage); } // Update soil moister every 2 seconds setInterval(onTimer, 2000); // Update soil moister immediately onTimer();
To bad there are no bluetooth support yet :(
Ahh - but there is now Bluetooth support for the esp32!
Nice! I just asumed because of the documentation sudgested otherwise :)
@Wilberforce started
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.
Good news!
Even got it work on a esp32 with espruino
Here is the code
To bad there are no bluetooth support yet :(