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

Scratch Usage for the Adapters

When using scratch 1.4, there are a few configuration steps needed in order to make the adapters from scratchClient available.

The steps described here are tailored to the current configuration in scratchClient.

Enable 'remote sensor connections'

In scratch, enable 'remote sensor connections'

In the scratch palette, go to the 'Sensing' palette

With the mouse, rightclick in the sensor reporter block

In the context menu, select 'enable remote sensor connections'

Scratch displays a dialog, just press ok

Sending values to scratchClient

% if len(list_adapter_input_values) == 0:

There are no variables sent from scratch to the current adapters.

% else:

In scratch, create variables with the following names:

In the Variables palette

Make a variable

Be sure to use the scope 'for all sprites'.

% endif

Sending events to scratchClient

% if len(list_adapter_input_commands) == 0:

There are no events sent from scratch to the current adapters.

% else:

In scratch, use broadcast events with the following names:

In the Control palette

Select broadcast block

Click on the small black arrow and select 'new'

Enter the broadcast name into the dialog

Use exactly the names given in the list above.

% endif

Receiving values from the adapters to scratch

Values from the adapters to scratch are sent through sensor values

% if len(list_adapter_output_values) == 0:

There are no sensor values sent by current adapters to scratch.

% else:

The values from the adapters are sent through sensor values to scratch:

The names displayed contain some names which are always included. The names from the adapters are added at the end of the list

Please note that your scratch will give a different view than this screenshot.

The list gets populated when the adapter send values.

% endif

Receiving events from the adapters in scratch

scratch receives broadcast events from the adapters

% if len(list_adapter_output_commands) == 0:

There are no events sent from the current adapters to scratch.

% else:

The event names from the adapters are:

The events are triggering the 'event hat' blocks.

The list in the block gets populated when events are arriving. Or use the edit feature to add events manually from the list above

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