Hardware Reference
In-Depth Information
b . analogRead ( POT , onAnalogRead );
}
// Handle data back from potentiometer
function onAnalogRead ( x ) {
if (! x . err && typeof x . value == 'number' ) {
pushData ( x . value );
}
setTimeout ( drawGraph , 20 );
}
function pushData ( y ) {
if ( data . length && ( data . length + 1 ) > totalPoints ) {
data = data . slice ( 1 );
}
if ( data . length < totalPoints ) {
data . push ( y );
}
}
function getData () {
var res = [];
for ( var i = 0 ; i < data . length ; ++ i ) {
res . push ([ i , data [ i ]]);
}
var series = [{
data : res ,
lines : {
fill : true
}
}];
return series ;
}
}
Direct the browser where to find the Bone. After it is initialized, it calls run to get
things going.
Read in the BoneScript library.
 
 
 
 
 
Search WWH ::




Custom Search