blockly (scratch-blocks) based horizontal interface compatable with lego's wedo2.0
  • JavaScript 90.7%
  • HTML 7.6%
  • CSS 1.7%
Find a file
2026-03-14 16:13:19 +01:00
scratch-blocks@51634f2ac8 added saving and loading, improved some things 2026-03-12 23:23:21 +01:00
scratch-editor@a8bbfd64d6 got scratch vm partially working 2026-03-11 02:00:35 +01:00
.gitignore added saving and loading, improved some things 2026-03-12 23:23:21 +01:00
.gitmodules cleaned the code up a bit 2026-03-12 16:23:44 +01:00
blocklycfg.js added saving and loading, improved some things 2026-03-12 23:23:21 +01:00
dist-sens.svg.js initial commit 2025-08-13 01:08:18 +02:00
index.html added saving and loading, improved some things 2026-03-12 23:23:21 +01:00
index.js initial commit 2025-08-13 01:08:18 +02:00
motor.svg.js initial commit 2025-08-13 01:08:18 +02:00
package.json added saving and loading, improved some things 2026-03-12 23:23:21 +01:00
readme.md added readme 2026-03-13 00:09:39 +01:00
script.js added led, fixed motors, added distance hat 2026-03-14 16:13:19 +01:00
style.css forgot to add files 2026-03-12 16:32:20 +01:00
wedo-hub.svg.js initial commit 2025-08-13 01:08:18 +02:00

WeDo2.0 protocol capable controller

This project is able to control devices using the WeDo2.0 protocol.

Implementation notes

This project uses scratch-blocks, a modified version of google's Blockly by the Scratch foundation, to put together blocks a horizontal layout and the scratch-vm interpreter to execute the code made with the blocks.

Since the scratch-vm interpreter is made for scratch-blocks vertical layout with scratch gui, some modifications are neccessary to the instance of scratch-vm being used.

these include:

  • modifying the updateGlows function to glow/unglow individual blocks
  • removing all loadExtension* functions to avoid loading a nonexistant wedo extension "requested" by scratch-blocks (to fix saving and loding)
  • change the code executed for some blocks to be compatable with my implementation of the WeDo2.0 protocol and getting some parts of the horizontal layout to work

WeDo2.0

The actual WeDo2.0 protocol is relatively simple, there are different characteristics for different types of IO, like reading (charty.sensors), writing (charty.output), configuring outputs (charty.portDef for writing, charty.portType for getting notifications of new or changing devices), and the button on the wedo (charty.button, I do not know why this has to be a seperate characteristic)

Most of the communication on writable channels is relatively straightforward, portDef is still a half mystery to me. This project might be a reference