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

  1. {
  2. "BLOCKPLUGINS": [
  3. [
  4. "accelerometerx",
  5. "var accelerometerXBlk = new ProtoBlock('accelerometerx');accelerometerXBlk.palette = palettes.dict['sensors'];blocks.protoBlockDict['accelerometerx'] = accelerometerXBlk;accelerometerXBlk.staticLabels.push(_('motion x'));accelerometerXBlk.adjustWidthToLabel();accelerometerXBlk.parameterBlock();"
  6. ],
  7. [
  8. "accelerometery",
  9. "var accelerometerYBlk = new ProtoBlock('accelerometery');accelerometerYBlk.palette = palettes.dict['sensors'];blocks.protoBlockDict['accelerometery'] = accelerometerYBlk;accelerometerYBlk.staticLabels.push(_('motion y'));accelerometerYBlk.adjustWidthToLabel();accelerometerYBlk.parameterBlock();"
  10. ],
  11. [
  12. "accelerometerz",
  13. "var accelerometerZBlk = new ProtoBlock('accelerometerz');accelerometerZBlk.palette = palettes.dict['sensors'];blocks.protoBlockDict['accelerometerz'] = accelerometerZBlk;accelerometerZBlk.staticLabels.push(_('motion z'));accelerometerZBlk.adjustWidthToLabel();accelerometerZBlk.parameterBlock();"
  14. ]
  15. ],
  16. "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)\");}",
  17. "ARGPLUGINS": [
  18. [
  19. "accelerometerx",
  20. "var block = logo.blocks.blockList[blk];block.value = accelerometer['x'];"
  21. ],
  22. [
  23. "accelerometery",
  24. "var block = logo.blocks.blockList[blk];block.value = accelerometer['y'];"
  25. ],
  26. [
  27. "accelerometerz",
  28. "var block = logo.blocks.blockList[blk];block.value = accelerometer['z'];"
  29. ]
  30. ]
  31. }