Skip to content

Commit 0313b9a

Browse files
committed
[ADD] converter of microbit_pin_connected function
1 parent 70be20b commit 0313b9a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/lib/ruby-to-blocks-converter/microbit.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ const MicroBitConverter = {
4646
this._setParent(rubyBlock, block);
4747
}
4848
break;
49+
case 'microbit_pin_connected':
50+
if (args.length === 2 && this._isNumber(args[1])) {
51+
block = this._createBlock('microbit_whenPinConnected', 'hat');
52+
this._addFieldInput(
53+
block, 'PIN', 'microbit_menu_touchPins', 'touchPins',
54+
args[1], '0'
55+
)
56+
this._setParent(rubyBlock, block);
57+
}
58+
break;
4959
}
5060
} else if (this._isSelf(receiver) || receiver === Opal.nil) {
5161
switch (name) {

0 commit comments

Comments
 (0)