An archive of as of Saturday January 26, 2019.

Small Error in dht11.nut Comments at the top


It's not in the code but in the comment section at the very top.

This is the part I'm talking about:

// Example usage:
// sensor <- DHT11(/*Pin*/ 6, /*PWM*/ 1, /*Channel*/ 0, /*Divider*/ 256);
// while(true) {
// local values =;
// print(format("humidity: %f%% temperature: %fC\n", values[0], values[1]);
// delay(2000);
// }

There needs to be another ) at the end to close the print command. So it should look like this:
print(format("humidity: %f%% temperature: %fC\n", values[0], values[1]));

Not a big deal but used that code and couldn't figure out why I was getting the error I was.

Also It might be a good thing to add that you need the following libraries to run the code.
Something like:
// This library requires the following libraries though the string library is for the Example Usage code.
// require(["GPIO", "Capture", "string"]);