Mobsya / blockly

The web-based visual programming editor.
https://developers.google.com/blockly/
Apache License 2.0
1 stars 9 forks source link

Subsets of proximity sensors #10

Open motib opened 7 years ago

motib commented 7 years ago

What is really cool about VPL is that you can set an event for an arbitrary subset of the sensors detecting or not detecting. While it might be difficult to provide the same functionality in Blockly, some thought should be given to improving the current situation. Even something as simple as stopping the Thymio when the end of the table is reached is difficult because a compound logically condition is needed: on proximity sensors updated if left not detect and right not detect

stephanemagnenat commented 7 years ago

I agree, it is a interesting question, maybe there could be semi-visual blocks a bit closer to VPL ones. This is not likely to be done within this version of Blockly, but with the new one from Google that merges with Scratch, this should be easier.

motib commented 7 years ago

I am perfectly OK with having only text blocks; if you want visual blocks, VPL is fantastic and you don't need Blockly or Scratch. Even in Scratch, fields of blocks are limited to text, numbers and colors. All I was asking for is more (text) choices in the pulldown menus of the blocks.

stephanemagnenat commented 7 years ago

Suggestions and mockups on how to improve the current situation with purely text blocks is welcome :-)

motib commented 7 years ago

Horizontal sensors: on X sensor detecting Y: add "all" and "none" to the pulldown for X.

Ground sensors: on X ground sensor detecting Y: add "both" and "neither" to the pulldown for X. Alternatively (better), add a block: on left ground sensor detecting Y1 and right ground sensor detecting Y2.

This is important because you want to avoid the difficult topic of logical operators in order to implement line following. If the alternative block is implemented then the "and" just looks like natural language and shouldn't be a problem.