Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var result = msg.payload; | |
try { | |
msg.topic="ccost/" + result.msg.sensor; | |
msg.payload = (result.msg.ch1[0].watts[0])*1; | |
return msg; | |
} catch( e ) | |
{ | |
// console.log("Looks like history data"); | |
} | |
return null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hardware.pin1.configure(ANALOG_IN); | |
// LED pin config | |
hardware.pin2.configure(DIGITAL_OUT_OD_PULLUP); | |
// initially set to off | |
hardware.pin2.write(0); | |
/* | |
If you don't have a Hannah board but want to try the | |
Cosm.com temperature logging exercise, here it is! |