Last active
September 9, 2019 10:10
-
-
Save azaharafernandezguizan/05e4d14d6f14edc8822c6d6467991178 to your computer and use it in GitHub Desktop.
Example of hello World on GPIO
This file contains 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 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