% if debug: % endif <%include file="/template/header.html" />

ScratchClient bridge to scratch2

This documentation is applicable to connect the raspbery pi standalone version of scratch2 with scratchClient.

Connecting scratch2 to hardware can be done in two different ways.
Option 2 is the recommended procedure.

Option 1: File Menu

Start scratchClient with the configuration xml file for your hardware.

Start scratch2, available from the desktop menu 'programming/scratch2'.

Press shift key and the file menu. The file menu now displays more options.

Select 'Import experimental extension'

Paste the following url into the form http://localhost:8080/scratchx/js/extension.js
Use ctrl-v to insert in to the dialog.

Check in 'more blocks' that the scratchClient connection is up and running.

Option 2: ScratchClient Extension

Install the scratch2 extension for scratchClient. This install step needs to be done only once.

cd ~/scratchClient/tools/scratch2connection
sudo python3 install.py
            

Start scratchClient with the configuration xml file for your hardware.

Start scratch2, available from the desktop menu 'programming/scratch2'.

In 'more blocks'

Select 'Add an extension.'

Be sure that scratchClient is running when opening the connection.

You get a block 'Load scratchClient blocks' which loads the extension.

There are always some more options, and you can select now to use 'workshop mode' or 'verbose mode'. Write the small script as shown in the script area of above image. At green flag, the extension is loaded. Start all other scripts in your program then with START-event.

Workshop mode gives you four blocks and inside each block you can select the name of variable or event. This mode should be used when you often redefine your adapters.

The 'undef' names are needed for technical reasons and should not be used.

Verbose mode gives you one block per variable send or receive and for each event send or receive. This is the recommended mode when you have a well defined adapter structure in scratchClient.

Check in 'more blocks' that the scratchClient connection is up and running. You should see a green dot on the right side of the extension.

The loader block is a modified source from https://megjlow.github.io/extensionloader.js

<%include file="/template/footer.html" /> % if debug: % endif