Skip to content

Instantly share code, notes, and snippets.

@DiegoTc
Forked from jadonk/fiddle.html
Last active August 29, 2015 14:00
Show Gist options
  • Save DiegoTc/11370697 to your computer and use it in GitHub Desktop.
Save DiegoTc/11370697 to your computer and use it in GitHub Desktop.
<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>
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);
}
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