import 'babel-polyfill';
//import {Gpio} from 'onoff';

var sensor = require('node-dht-sensor');

  console.info("System is started now!");

setInterval(showTemp, 1000);


var showTemp =  sensor.read(22, 18, function(err, temperature, humidity) {
      if (!err) {
          console.log('temp: ' + temperature.toFixed(1) + '°C, ' +
              'humidity: ' + humidity.toFixed(1) + '%'
          );
      }
});





/*
const Gpio = require('onoff').Gpio;

const receiverIR = new Gpio(18, 'in', 'both');

  console.info("System is started now!");


receiverIR.watch(async function(err, value){
  if (err) {
      console.error(err);
  }

  console.info(value);

});
*/

@@ -95,96 +95,51 @@
 );%0A%0A
-  console.info(%22System is started now!%22);%0A%0AsetInterval(showTemp, 1000);%0A%0A%0Avar showTemp =
+setTimeout(loop, 1000);%0A%0Afunction loop() %7B%0A
   se
@@ -360,13 +360,43 @@
   %7D%0A
+  
 %7D);%0A%0A
+  setTimeout(loop, 1000);%0A%7D%0A
 %0A%0A%0A%0A

send source