Scratch Blocks - MrYsLab/xideco GitHub Wiki

The Scratch blocks for Xideco are essentially the same as the blocks for s2aio, with the exception that an additional drop down list has been added to allow you to assoicate a specific physical board with the block.

These blocks can be used with Arduino, RaspberryPi and BeagleBone boards.

Scratch projects that contain these blocks may be found in the xideco/data_files/scratch_files/projects directory

For release 0.3.0, a minor change to the blocks was made. The "pin" fields were changed from accepting numeric input to alphanumeric input to accommodate the BeageBone Black pin designations. If you have an existing Scratch project using the older style blocks, it will still work. However, if you wish to add support to a Scratch project for the BeagleBone block, and the project was created prior to version 0.3.0, you will need to use the latest block definitions.

The board selector is located on the extreme left hand side of all the blocks.

Please note: Currently only Scratch is supported. Blocks for Snap! will be available sometime in the future.

Click here for block documentation.

Raspberry PI Specifics

The Raspberry PI SONAR support requires the use of 2 pins as opposed to the Arduino which utilizes a single pin. To accommodate inputting 2 pins, use the following convention:

pin1.pin2

So for example if you are using GPIO 4 for the trigger and GPIO 17 for the echo, the pin number is specified as: 4.17

To retrieve Sonar values, use the trigger pin number in the Read Digital Pin block.

BeagleBone Black Specifics

The HC-SR04 Distance module is not currently supported but the GP2Y0A21YK0F Infrared distance sensor is. Distances are reported in centimeters. A wiring diagram can be found here.