-
-
Save DiegoTc/11370697 to your computer and use it in GitHub Desktop.
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
<h1>BoneScript Flot Demo</h1> | |
<div id="myplot" style="width:500px;height:300px;"></div> | |
<p><a href="https://gist.github.com/jadonk/9602198">fork me on github</a></p> |
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
setTargetAddress('beaglebone.local', { | |
initialized: run | |
}); | |
setTargetAddress('192.168.7.2', { | |
initialized: run | |
}); | |
function run() { | |
var b = require('bonescript'); | |
var led = "P8_10"; | |
var state = 0; | |
b.pinMode(led, 'out'); | |
toggleLED = function() { | |
state = state ? 0 : 1; | |
b.digitalWrite(led, state); | |
}; | |
timer = setInterval(toggleLED, 100); | |
stopTimer = function() { | |
clearInterval(timer); | |
}; | |
setTimeout(stopTimer, 3000); | |
} |
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
name: BoneScript Flot Demo | |
description: Put a BeagleBone on your network with a potentiometer (between 0 and 1.8V) on P9_36 to see a simple jQuery Flot graph. | |
authors: | |
- Jason Kridner | |
resources: | |
- http://www.flotcharts.org/flot/jquery.flot.js | |
- http://beagleboard.org/static/bonescript.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment