Skip to content

Commit 480fb92

Browse files
authored
Merge pull request #2 from DenisaCG/blocks
Added MoveHub blocks
2 parents 11db439 + a535a64 commit 480fb92

File tree

7 files changed

+826
-1
lines changed

7 files changed

+826
-1
lines changed

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,8 @@ tests
66

77
**/__tests__
88
ui-tests
9+
10+
examples
11+
.eslintignore
12+
.eslintrc.js
13+
.gitignore

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ global-exclude *.pyc
2323
global-exclude *.pyo
2424
global-exclude .git
2525
global-exclude .ipynb_checkpoints
26+
27+
# Examples
28+
recursive-include examples *.jpblockly

examples/movement-example.jpblockly

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"blocks":{"languageVersion":0,"blocks":[{"type":"lego_boost_connect","id":"F*~S%zcX8kF{k[7S}B9S","x":186,"y":68,"inputs":{"BLUETOOTH_ADDRESS":{"block":{"type":"text","id":"nz!unaesW8/eIfrWq=GE","fields":{"TEXT":"00:16:53:C3:C2:4F"}}}},"next":{"block":{"type":"lego_boost_move_motor_ab_timed","id":"F`71S/WoL(;FaWto8nD(","inputs":{"TIME":{"block":{"type":"math_number","id":"A}[_u61~_0iBLpu=QP4,","fields":{"NUM":0.7}}},"SPEED_A":{"block":{"type":"math_number","id":"M7S@mLwsP+i:0OTGSd~i","fields":{"NUM":0.6}}},"SPEED_B":{"block":{"type":"math_number","id":"8wW:AAU3DplC`EpiOzQo","fields":{"NUM":0.6}}}},"next":{"block":{"type":"lego_boost_move_motor_a_timed","id":"N@+KX-;Q.]cAIEdT_-tJ","inputs":{"TIME":{"block":{"type":"math_number","id":"2Y=;7DDj@,0?eCI[A+(,","fields":{"NUM":0.4}}},"SPEED":{"block":{"type":"math_number","id":"p!RfD!vB/v:?,Ad;{g=F","fields":{"NUM":0.6}}}},"next":{"block":{"type":"lego_boost_move_motor_ab_timed","id":"lnG#K[jC+sn!0YRcm!$v","inputs":{"TIME":{"block":{"type":"math_number","id":"azDfaMx-7,I=Y($=Dae:","fields":{"NUM":0.5}}},"SPEED_A":{"block":{"type":"math_number","id":"623:eCp-F;rj{^jpK{vj","fields":{"NUM":-0.8}}},"SPEED_B":{"block":{"type":"math_number","id":"tH|x_u9m.cl-Qy3V[}U6","fields":{"NUM":-0.8}}}},"next":{"block":{"type":"lego_boost_move_motor_b_timed","id":"mOLMUFvEew=$-y/s1_IZ","inputs":{"TIME":{"block":{"type":"math_number","id":"ra74OG{+I^x.x6:124AH","fields":{"NUM":0.3}}},"SPEED":{"block":{"type":"math_number","id":"TM2W1k*Xor?xvx03ghFd","fields":{"NUM":0.6}}}},"next":{"block":{"type":"lego_boost_move_motor_ab_timed","id":"(Z14Q,q?@b-6R~`f6$/w","inputs":{"TIME":{"block":{"type":"math_number","id":"TXHO~{bLggB~0MsL$+ub","fields":{"NUM":0.4}}},"SPEED_A":{"block":{"type":"math_number","id":"=0SA=L=(z8S912]d-ig.","fields":{"NUM":0.6}}},"SPEED_B":{"block":{"type":"math_number","id":";]LVpX+vE+A]Q)wx9m$y","fields":{"NUM":0.6}}}},"next":{"block":{"type":"lego_boost_stop_motors","id":"2ZpnNOZ26gmKCeaFx-Rl","next":{"block":{"type":"lego_boost_disconnect","id":"dPdr)2XfSZ1++W%IO399"}}}}}}}}}}}}}}}]}}

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@
5555
include_package_data=True,
5656
python_requires=">=3.7",
5757
install_requires=['jupyterlab-blockly>=0.1.1,<0.2'],
58+
extras_require={
59+
'env': ['bleak', 'pylgbst']
60+
},
5861
platforms="Linux, Mac OS X, Windows",
5962
keywords=["Jupyter", "JupyterLab", "JupyterLab3"],
6063
classifiers=[

src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import {
55

66
import { IBlocklyRegistry } from 'jupyterlab-blockly';
77

8+
import BlocklyBoost from './lego_boost_python_generators_and_blocks';
9+
810
/**
911
* Initialization data for the jupyterlab-lego-boost extension.
1012
*/
@@ -14,6 +16,9 @@ const plugin: JupyterFrontEndPlugin<void> = {
1416
requires: [IBlocklyRegistry],
1517
activate: (app: JupyterFrontEnd, blockly: IBlocklyRegistry) => {
1618
console.log('JupyterLab extension jupyterlab-lego-boost is activated!');
19+
20+
//Registering the new toolbox containing all Lego Boost blocks.
21+
blockly.registerToolbox('boost', BlocklyBoost.Toolbox);
1722
}
1823
};
1924

0 commit comments

Comments
 (0)