aboutsummaryrefslogtreecommitdiff
path: root/code/004-display.js
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2017-02-23 22:11:21 +0100
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2017-02-23 22:11:21 +0100
commit6cb056f979f20e895930940c94b05767d081dd61 (patch)
tree9e3ece401941b735b34d090f0d76d11bf4d52d5a /code/004-display.js
parentb44d4c151b0ebc4284122530ac3d6e5f19e15bf5 (diff)
Some additional slides
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