-
Sat 2019.07.27
Welcome to the world of Javascript @user98241 as I know you will enjoy many hours of discovery with your purchase of Pixl.
'We are beginners with javascript'
Excellent resource with a tryit window option:
The language itself:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/var
'are confused why certain parts of the code are commented out'
On the 'Grove' page, the code within the commented out sections just indicate an alternate way in which commands could be used. It's there to aid as a hint, and to avoid having to look up each command, which may be done at:
It also appears that the commented out sections may be a suggestion on how to set up the declarations section, and the viewable code lines show usage, for the specific section beneath the heading in blue.
' what we would put in the (...) sections'
Is there a specific example? It would depend on which command, which sensor etc. A combination of command lookup in the above link, and searching the manufacturer data sheet would be a good idea.
'there aren't many examples on how to use them together'
On the device specific page, beneath the Tutorials heading there are at least fifty:
'any sample code we could refer to in javascript for the other sensors'
Has the tutorials and samples page been discovered yet? Tons there also:
A good overview of a complete code example with the Pixl:
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!