Skip to content

Instantly share code, notes, and snippets.

@manduks
Last active December 10, 2016 23:32
Show Gist options
  • Save manduks/ec7be13b1833a120f60ed1b0588a71ad to your computer and use it in GitHub Desktop.
Save manduks/ec7be13b1833a120f60ed1b0588a71ad to your computer and use it in GitHub Desktop.
TemperatureModule.prototype.when = function(event, callback, value) { // 'medir', callback
temp.on('Measurement',(_value)=>{
if(value === _value) {
callback();
//lcd.home();
//lcd.message("Temp [C]: " + _value.toFixed(2));
}
});
}
params: {
code: 'temperature.when('medir', function () {
led.blink();
}, 45);'
}
//server
eval(params.code);
//prender leds
ledRGB.turnOn('led01', '#FF0000');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment