not really known
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

31 lines
4.1 KiB

{
"BLOCKPLUGINS": [
[
"accelerometerx",
"var accelerometerXBlk = new ProtoBlock('accelerometerx');accelerometerXBlk.palette = palettes.dict['sensors'];blocks.protoBlockDict['accelerometerx'] = accelerometerXBlk;accelerometerXBlk.staticLabels.push(_('motion x'));accelerometerXBlk.adjustWidthToLabel();accelerometerXBlk.parameterBlock();"
],
[
"accelerometery",
"var accelerometerYBlk = new ProtoBlock('accelerometery');accelerometerYBlk.palette = palettes.dict['sensors'];blocks.protoBlockDict['accelerometery'] = accelerometerYBlk;accelerometerYBlk.staticLabels.push(_('motion y'));accelerometerYBlk.adjustWidthToLabel();accelerometerYBlk.parameterBlock();"
],
[
"accelerometerz",
"var accelerometerZBlk = new ProtoBlock('accelerometerz');accelerometerZBlk.palette = palettes.dict['sensors'];blocks.protoBlockDict['accelerometerz'] = accelerometerZBlk;accelerometerZBlk.staticLabels.push(_('motion z'));accelerometerZBlk.adjustWidthToLabel();accelerometerZBlk.parameterBlock();"
]
],
"GLOBALS": "accelerometer = {'x': null, 'y': null, 'z': null};function saveAccelerometerData(event) { accelerometer['x'] = event.accelerationIncludingGravity.x; accelerometer['y'] = event.accelerationIncludingGravity.y; accelerometer['z'] = event.accelerationIncludingGravity.z;};if (window.DeviceMotionEvent) { window.addEventListener(\"devicemotion\", saveAccelerometerData, false);}else{ console.log(\"DeviceMotionEvent is not supported (no accelerometer)\");}",
"ARGPLUGINS": [
[
"accelerometerx",
"var block = logo.blocks.blockList[blk];block.value = accelerometer['x'];"
],
[
"accelerometery",
"var block = logo.blocks.blockList[blk];block.value = accelerometer['y'];"
],
[
"accelerometerz",
"var block = logo.blocks.blockList[blk];block.value = accelerometer['z'];"
]
]
}