Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / april_temp_sensor
Created December 27, 2012 07:11
Code for April Electric Imp board - temp logger using a TMP36 from adafruit
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!
@thiseldo
thiseldo / gist:7402637
Created November 10, 2013 19:25
A quick CurrentCost to Node-RED function to read each channel and split out to topic/payload. Next node could be to publish to a mqtt topic that has already been defined in this node.
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;
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.