Created
October 29, 2015 14:13
-
-
Save peter279k/2c9fff36202837f66c5f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$(function() { | |
var board, led, pin = 0; | |
for(var i=8;i<=9;i++) { | |
$("#board").append("<wa-led id='" + "led" + i +"' pin='"+ i +"'></wa-led>"); | |
} | |
window.addEventListener('WebComponentsReady', function () { | |
board = document.getElementById('board'); | |
board.on('ready', function ready() { | |
$("#on-btn").click(function (event) { | |
if(pin == 0) { | |
$("#led8").led_on(); | |
$("#led9").led_off(); | |
} | |
}); | |
$("#off-btn").click(function (event) { | |
$("#led8").led_off(); | |
$("#led9").led_off(); | |
}); | |
}); | |
}, false); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment