From 6cb056f979f20e895930940c94b05767d081dd61 Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Thu, 23 Feb 2017 22:11:21 +0100 Subject: Some additional slides --- code/004-display.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 code/004-display.js (limited to 'code/004-display.js') 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 -- cgit v1.2.3