Skip to content

Commit f8ab075

Browse files
committed
wedo2のwedo2_set_motor_directionRubyからブロックに変換できるようにしました
1 parent a3e6c83 commit f8ab075

File tree

1 file changed

+15
-0
lines changed
  • src/lib/ruby-to-blocks-converter

1 file changed

+15
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,21 @@ const Wedo2Converter = {
4040
this._addNumberInput(block, 'POWER', 'math_number', args[1], 100);
4141
break;
4242
}
43+
case 'wedo2_set_motor_direction':
44+
if (args.length === 2 && this._isString(args[0]) && this._isString(args[1])){
45+
block = this._createBlock('wedo2_setMotorDirection', 'statement');
46+
this._addInput(
47+
block,
48+
'MOTOR_ID',
49+
this._createFieldBlock('wedo2_menu_MOTOR_ID', 'MOTOR_ID', args[0])
50+
);
51+
this._addInput(
52+
block,
53+
'MOTOR_DIRECTION',
54+
this._createFieldBlock('wedo2_menu_MOTOR_DIRECTION', 'MOTOR_DIRECTION', args[1])
55+
);
56+
}
57+
break;
4358
case 'wedo2_set_light_color':
4459
if (args.length === 1 && this._isNumberOrBlock(args[0])) {
4560
block = this._createBlock('wedo2_setLightHue', 'statement');

0 commit comments

Comments
 (0)