-
@Gordon Hmm it kind of works, but I need to be 10cm from it. The d30/d31 does not work. I have the short one in the d31. Do I need a resistor? Any ideas?
-
Thanks @Gordon, that is what I like to call good customer service!
-
Hi, thank you @Gordon, I’m using 2.05 firmware and My puck was bought several years ago so I guess it’s the first version? didn’t know there was a new one
-
-
Hello im trying to send a signal from my puckjs with an external ir led to a remote controlled fan. I tried the tutorial with capturing data from the remote control and got some values to my ir receiver . I tried the ordinary built in IR but it did not work i tried to capture the signal with another puck but it sends no signal. I have attached my code. What pins should i use for the ir led? i have used d30 and d31.
Any ideas?
-
-
Im trying to broadcast ble data with the esp32. But its not implemented yet the console informs me. Didnt you guys say it worked now?
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); var hp = map_value(h, low, high, 0, 100); var percentage = hp.toFixed(0)+"%"; NRF.setServices({ 0xBCDE : { 0xABCD : { value : percentage, readable : true } } }); console.log("Soil moister", percentage); } // Update soil moister every 2 seconds setInterval(onTimer, 2000); // Update soil moister immediately onTimer();
Console
Soil moister 0% WARNING: has connected not implemented yet
-
-
Good news!
Even got it work on a esp32 with espruino
Here is the codevar 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 :(
-
-
I came up with this
var high = 0.55; var low = 0.0017; 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(A0); var hp = map_value(h, low, high, 0, 100); var percentage = hp.toFixed(0)+"%"; // 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(10); g.drawString(percentage, 5,10); // Update the screen g.flip(); } // Update soil moister every 2 seconds setInterval(onTimer, 2000); // Update soil moister immediately onTimer();
Feedback on the code is welcome
I have 3 pucks im gooing to try next :) Im gooing to send via bluetooth to my pixl.js
edit:
Strange the high and low changes with battery vs plug -
hmm 3.3v seems to work now.
in water
h = 0.45629882812
h = 0.45678710937
h = 0.45971679687
h = 0.46044921875
h = 0.46020507812
h = 0.4619140625
h = 0.4619140625
h = 0.462890625
h = 0.46362304687in air
h = 0.00024414062
h = 0.00048828125
h = 0.0009765625
h = -0.00024414062
h = 0.00024414062Now i just have to calculate it in %, an have som treshold for 0% because of the fluxuation, maybe an upper limit too?
I will check the code you guys provided :)
-
-
-
-
-
-
-
-
-
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,3Vfunction 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();
-
@Gordon got it to work. With the externa led My leads didn’t touch the metal.