Skip to content
JamesNewton edited this page Dec 11, 2018 · 12 revisions

The scratch programming language is a popular option to teach programming with a visual, block, based user interface.
https://scratch.mit.edu/

A Scratch extension has been developed to allow Dexter to be controlled with simple blocks.
https://github.com/Kenny2github/scratch-dexter
https://www.facebook.com/steamaker/videos/577470826025034/

To setup communications between Dexter and your browser, a Node.JS proxy between websockets and Dexter's raw socket interface is required. To set that up:

  • Node.js installed on your local machine
    https://nodejs.org/en/download/
  • Make a folder, and at the command prompt, npm init it and install ws. You can just take the defaults for each question during the init. e.g.
mkdir DexProxy
cd DexProxy
npm init
npm install ws

Once you have all that setup,

  • node httpd.js dexter_ip where dexter_ip is the IP address of the dexter robot.
  • Go to
    https://scratchx.org/?url=https://jamesnewton.github.io/scratch/ext.js

    and accept the warning. Drag the black "move all joints" block over into the script area on the right. You can click on "events" above and drag a "when (flag) clicked" over on top of it, the click the green flag on the left or just double click the move all joints block.

Clone this wiki locally