We are beginners with javascript and are confused on how to interface the sensors with the Pixl.js.
It doesn't seem too complicated, but there aren't many examples on how to use them together. We've looked at this, but are confused why certain parts of the code are commented out, or what we would put in the (...) sections. http://www.espruino.com/Grove
Also, specifically for the temp + humidity sensor, we found the DHT11 module and tried using that as well:
var dht = require("DHT22").connect(D3);
dht.read(function (a) {console.log(JSON.stringify(a));});
But this doesn't return any raw values.
temp and humidity = -1
The sensor should be connected to the right pin and we have also made sure to flash the Pixl.js with the most recent firmware 2v04. What could be the issue with this?
Also, is there any sample code we could refer to in javascript for the other sensors?
Thanks!
Using the Pixl should be almost the same as any other Espruino, pins are different, and different amount of peripherials, but most basic examples in most tutorials should work just fine.
The DHT11 and DHT22 use different protocol. Are you using the right one?
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!
We are beginners with javascript and are confused on how to interface the sensors with the Pixl.js.
It doesn't seem too complicated, but there aren't many examples on how to use them together. We've looked at this, but are confused why certain parts of the code are commented out, or what we would put in the (...) sections.
http://www.espruino.com/Grove
Also, specifically for the temp + humidity sensor, we found the DHT11 module and tried using that as well:
But this doesn't return any raw values.
temp and humidity = -1
The sensor should be connected to the right pin and we have also made sure to flash the Pixl.js with the most recent firmware 2v04. What could be the issue with this?
Also, is there any sample code we could refer to in javascript for the other sensors?
Thanks!