@@ -0,0 +1,1452 @@
+var j5 = require('johnny-five'),%0A    HI = require('heat-index'),%0A    arduino = new j5.Board(),%0A    COMMAND = %7B%0A        TH: %7B%0A            GET: 'TH:get'%0A        %7D,%0A        AC: %7B%0A            TOGGLE: 'AC:toggle'%0A        %7D%0A    %7D;%0A%0A// SysEx STRING_DATA handler%0Afunction onString(data) %7B%0A    var response = parseStringMessage(data);%0A    if (response.type === 'XX') %7B%0A        console.log(data);%0A        return;%0A    %7D%0A    if (response.type === 'TH') %7B%0A        console.log(response)%0A    %7D else if (response.type === 'AC') %7B%0A        arduino.emit('AC:toggled', response);%0A    %7D%0A%7D%0A%0A// format string data to object%0Afunction parseStringMessage(data) %7B%0A    var response = %7B%0A        type : data.split(':', 2)%5B0%5D,%0A        body : data.split(':', 2)%5B1%5D%0A    %7D;%0A    if (response.type === 'TH') %7B%0A        response.temperature = parseFloat(response.body.split(',', 2)%5B0%5D);%0A        response.humidity = parseFloat(response.body.split(',', 2)%5B1%5D);%0A        response.heatIndex = HI.heatIndex(response);%0A    %7D%0A    return response;%0A%7D%0A%0A// send Temperature and Humidity request to Arduino%0Afunction requestTemperatureHumidity() %7B%0A    if (! arduino.io) %7B%0A        console.error('not connected to arduino.');%0A        return;%0A    %7D%0A    arduino.io.sendString(COMMAND.TH.GET);%0A    console.log('to arduino: sent TH request');%0A%7D%0A%0Aarduino.on('ready', function () %7B%0A    arduino.on('string', function (data) %7B%0A        onString(data);%0A    %7D);%0A    setInterval(requestTemperatureHumidity, 1000);%0A%7D);%0A

print temperature and humidity.