You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{"blocks":{"languageVersion":0,"blocks":[{"type":"lego_boost_connect","id":"e]+mHooe7Ytls}.|?e^d","x":107,"y":20,"icons":{"comment":{"text":"Make sure to add the bluetooth address of your own MoveHub! It can be found in the bluetooth settings of your laptop.","pinned":false,"height":80,"width":160}},"inputs":{"BLUETOOTH_ADDRESS":{"block":{"type":"text","id":"b):i%^D-2h,%)L8zw#0Z","fields":{"TEXT":"00:16:53:C3:C2:4F"}}}},"next":{"block":{"type":"lego_boost_sleep","id":"-|5d7;),*QGZpxy.ks,m","inputs":{"SECONDS":{"block":{"type":"math_number","id":".0x2@p`ORJ0It]w|3{AX","fields":{"NUM":1}}}},"next":{"block":{"type":"lego_boost_led_change","id":"R%UrPIdDOR$#42`y~z4)","icons":{"comment":{"text":"Click on the colored box to experiment and choose another color.","pinned":true,"height":80,"width":160}},"inputs":{"COLOR":{"block":{"type":"colour_picker","id":"0S-6tnnJi:UR1UJdge=n","fields":{"COLOUR":"#ff0000"}}}},"next":{"block":{"type":"lego_boost_sleep","id":"(lBR_5x[N#`oKDS8G#1O","inputs":{"SECONDS":{"block":{"type":"math_number","id":"_J-f$z{?J7e+7@t(5`xH","fields":{"NUM":1}}}},"next":{"block":{"type":"lego_boost_led_reset","id":"z|$l$//y$6FrAdZag/n~","next":{"block":{"type":"lego_boost_disconnect","id":"Zjo*_zbFq2(e]f$aHY(*"}}}}}}}}}}}]}}
{"blocks":{"languageVersion":0,"blocks":[{"type":"lego_boost_connect","id":"e]+mHooe7Ytls}.|?e^d","x":102,"y":48,"icons":{"comment":{"text":"Make sure to add the bluetooth address of your own MoveHub! It can be found in the bluetooth settings of your laptop.","pinned":false,"height":80,"width":160}},"inputs":{"BLUETOOTH_ADDRESS":{"block":{"type":"text","id":"b):i%^D-2h,%)L8zw#0Z","fields":{"TEXT":"00:16:53:C3:C2:4F"}}}},"next":{"block":{"type":"lego_boost_detect_color","id":"aY^kL(v4*GPowIO$K[/B","icons":{"comment":{"text":"This type of blocks will use the sensors in order to detect variations of the colour and distance for the selected time period.","pinned":false,"height":80,"width":160}},"inputs":{"TIME":{"block":{"type":"math_number","id":"xpRY*+VA6;QR)qISIt!=","fields":{"NUM":1}}}},"next":{"block":{"type":"lego_boost_disconnect","id":"Zjo*_zbFq2(e]f$aHY(*"}}}}}]}}
.appendField('Detect the color and distance for');
373
+
this.appendDummyInput().appendField('seconds');
374
+
this.setInputsInline(true);
375
+
this.setPreviousStatement(true,null);
376
+
this.setNextStatement(true,null);
377
+
this.setColour(lego_boost_color);
378
+
this.setTooltip(
379
+
'Use the color and distance sensor for detection, for a certain period of time.'
380
+
);
381
+
this.setHelpUrl('');
382
+
}
383
+
};
384
+
385
+
Blockly.Blocks['lego_boost_detect_color']={
386
+
init: function(){
387
+
this.appendValueInput('TIME')
388
+
.setCheck('Number')
389
+
.appendField('Detect the color for');
390
+
this.appendDummyInput().appendField('seconds');
391
+
this.setInputsInline(true);
392
+
this.setPreviousStatement(true,null);
393
+
this.setNextStatement(true,null);
394
+
this.setColour(lego_boost_color);
395
+
this.setTooltip(
396
+
'Use the color sensor for detection, for a certain period of time.'
397
+
);
398
+
this.setHelpUrl('');
399
+
}
400
+
};
401
+
402
+
Blockly.Blocks['lego_boost_detect_distance']={
403
+
init: function(){
404
+
this.appendValueInput('TIME')
405
+
.setCheck('Number')
406
+
.appendField('Detect the distance for');
407
+
this.appendDummyInput().appendField('seconds');
408
+
this.setInputsInline(true);
409
+
this.setPreviousStatement(true,null);
410
+
this.setNextStatement(true,null);
411
+
this.setColour(lego_boost_color);
412
+
this.setTooltip(
413
+
'Use the distance sensor for detection, for a certain period of time. Detect the distance until the object placed in front of the robot. The robot can detect a distance from 0 to 10 cm. The number is an integer.'
.appendField('Detect the reflected distance for');
424
+
this.appendDummyInput().appendField('seconds');
425
+
this.setInputsInline(true);
426
+
this.setPreviousStatement(true,null);
427
+
this.setNextStatement(true,null);
372
428
this.setColour(lego_boost_color);
373
-
this.setTooltip('Color sensor.');
429
+
this.setTooltip(
430
+
'Use the distance sensor for detection, for a certain period of time. Detect the reflected distance until the object placed in front of the robot. The result is a float number from 0 to 1.'
431
+
);
432
+
this.setHelpUrl('');
433
+
}
434
+
};
435
+
436
+
Blockly.Blocks['lego_boost_detect_luminosity']={
437
+
init: function(){
438
+
this.appendValueInput('TIME')
439
+
.setCheck('Number')
440
+
.appendField('Detect the RGB value for');
441
+
this.appendDummyInput().appendField('seconds');
442
+
this.setInputsInline(true);
443
+
this.setPreviousStatement(true,null);
444
+
this.setNextStatement(true,null);
445
+
this.setColour(lego_boost_color);
446
+
this.setTooltip(
447
+
'Use the distance sensor for detection, for a certain period of time. Detect the ambient RGB value of the object placed in front of the robot. '
448
+
);
449
+
this.setHelpUrl('');
450
+
}
451
+
};
452
+
453
+
Blockly.Blocks['lego_boost_detect_RGB']={
454
+
init: function(){
455
+
this.appendValueInput('TIME')
456
+
.setCheck('Number')
457
+
.appendField('Detect the ambient light value for');
458
+
this.appendDummyInput().appendField('seconds');
459
+
this.setInputsInline(true);
460
+
this.setPreviousStatement(true,null);
461
+
this.setNextStatement(true,null);
462
+
this.setColour(lego_boost_color);
463
+
this.setTooltip(
464
+
'Use the distance sensor for detection, for a certain period of time. Detect the ambient light value of the enviroment in front of the robot. The result is a float number from 0 to 1.'
465
+
);
466
+
this.setHelpUrl('');
467
+
}
468
+
};
469
+
470
+
Blockly.Blocks['lego_boost_set_sensor_color']={
471
+
init: function(){
472
+
this.appendDummyInput()
473
+
.appendField('Set sensor light to color')
474
+
.appendField(
475
+
newBlockly.FieldDropdown([
476
+
['Red','COLOR_RED'],
477
+
['Blue','COLOR_BLUE'],
478
+
['Cyan','COLOR_CYAN'],
479
+
['Yellow','COLOR_YELLOW'],
480
+
['White','COLOR_WHITE'],
481
+
['Black','COLOR_BLACK']
482
+
]),
483
+
'COLOR'
484
+
);
485
+
this.setInputsInline(true);
486
+
this.setPreviousStatement(true,null);
487
+
this.setNextStatement(true,null);
488
+
this.setColour(lego_boost_color);
489
+
this.setTooltip('Set the color of the sensor to one of the selected ones.');
490
+
this.setHelpUrl('');
491
+
}
492
+
};
493
+
494
+
Blockly.Blocks['lego_boost_button_state']={
495
+
init: function(){
496
+
this.appendDummyInput().appendField('Print the button state');
497
+
this.setInputsInline(true);
498
+
this.setPreviousStatement(true,null);
499
+
this.setNextStatement(true,null);
500
+
this.setColour(lego_boost_color);
501
+
this.setTooltip(
502
+
'Output the state of the button. The state is 0 for not pressed and 1 or 2 for pressed.'
503
+
);
374
504
this.setHelpUrl('');
375
505
}
376
506
};
@@ -669,9 +799,111 @@ BlocklyPy['lego_boost_set_led_brightness'] = function (block) {
0 commit comments