Skip to content

Instantly share code, notes, and snippets.

@azaharafernandezguizan
Last active September 9, 2019 10:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azaharafernandezguizan/05e4d14d6f14edc8822c6d6467991178 to your computer and use it in GitHub Desktop.
Save azaharafernandezguizan/05e4d14d6f14edc8822c6d6467991178 to your computer and use it in GitHub Desktop.
Example of hello World on GPIO
var Gpio = require('onoff').Gpio;
var LED = new Gpio(18, 'out’);
var ledInterval = setInterval(sayHello, 300);
function sayHello () {
if (LED.readSync() === 0) {
LED.writeSync(1); //se enciende
} else {
LED.writeSync(0); //se apaga
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment