Skip to content

Instantly share code, notes, and snippets.

@kd8bxp
kd8bxp / 0_reuse_code.js
Created October 23, 2016 01:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
hardware.pin9.configure(ANALOG_IN);
function getTemp() {
local supplyVoltage = hardware.voltage();
local voltage = supplyVoltage * hardware.pin9.read() / 65535.0;
local c = (voltage - 0.5) * 100 ;
local c_str = format("%.01f", c);
server.log("Current temp is "+c_str+" °C");