Skip to content

Commit 70be20b

Browse files
committed
[ADD] converter of microbit.tilt_angle function
1 parent 61d2923 commit 70be20b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,18 @@ const MicroBitConverter = {
9797
)
9898
}
9999
break;
100+
case 'tilt_angle':
101+
if (args.length === 1 && this._isString(args[0])) {
102+
block = this._changeBlock(receiver, 'microbit_getTiltAngle', 'value');
103+
delete this._context.blocks[receiver.inputs.EXPRESSION.block];
104+
delete receiver.inputs.EXPRESSION;
105+
106+
this._addFieldInput(
107+
block, 'DIRECTION', 'microbit_menu_tiltDirection', 'tiltDirection',
108+
args[0], 'front'
109+
)
110+
}
111+
break;
100112
}
101113
}
102114
return block;

0 commit comments

Comments
 (0)