aboutsummaryrefslogtreecommitdiff
path: root/code/004-display.js
diff options
context:
space:
mode:
Diffstat (limited to 'code/004-display.js')
-rw-r--r--code/004-display.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/code/004-display.js b/code/004-display.js
new file mode 100644
index 0000000..e7b4cd1
--- /dev/null
+++ b/code/004-display.js
@@ -0,0 +1,11 @@
+var dht = require("DHT22").connect(C11);
+
+I2C1.setup({scl:B6,sda:B7});
+var g = require("SH1106").connect(I2C1, start);
+
+dht.read(function (data) {
+ console.log("Read DHT22");
+ g.drawString("Temp: "+data.temp.toString(),2,2);
+ g.drawString(" RH: "+data.rh.toString(),2,10);
+ g.flip();
+}); \ No newline at end of file