Skip to content

Instantly share code, notes, and snippets.

@gsantiago
Created December 27, 2014 01:30
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 gsantiago/dc3289ba8356b33f85f3 to your computer and use it in GitHub Desktop.
Save gsantiago/dc3289ba8356b33f85f3 to your computer and use it in GitHub Desktop.
var lcd; // Declare a variável LCD aqui pra ser acessível por outras funções
var onArduinoReady = function () {
// Quando o arduino tiver pronto
// ...
lcd = new QualquerCoisa();
lcd.on('ready', onLcdReady);
};
var onLcdReady = function () {
// ...
mostraLcd()
};
var mostraLcd = function () {
// ...
// Objeto lcd estará acessivel aqui
};
arduino.on('ready', onArduinoReady)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment