Last active
January 24, 2017 00:26
-
-
Save masakick/8d930ea662e327604f2a584071930009 to your computer and use it in GitHub Desktop.
67ws example IOT for PC
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
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1"> | |
<title>PC側</title> | |
</head> | |
<body> | |
<div id="output"></div> | |
<script src="https://cdn.mlkcca.com/v0.6.0/milkcocoa.js"></script> | |
<script src="main-pc.js"></script> | |
</body> |
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
window.onload = function(){ | |
var output = document.getElementById('output'); | |
var milkcocoa = new MilkCocoa('maxiyarfndt.mlkcca.com'); | |
var ds = milkcocoa.dataStore('gravity'); | |
var counter = 0; | |
ds.on('send', changeViewFromSentMode); | |
function changeViewFromSentMode(sent){ | |
if(sent.value.furue){ | |
output.innerHTML = "ふるえてる"+ counter +"回目<br>" | |
counter ++; | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment