Alan Yorinks
Alan Yorinks
2 min read

Categories

  • scratch3
  • gpio

Moving Forward

This is going to be another short posting, allowing me to devote more time to develop, test, and document the OneGPIO Scratch 3 extensions.

Progress since the last posting:

  • Extension support for Arduino, ESP-8266, and Raspberry Pi has been broken out into three separate extensions allowing for:
    • The ability for multiple OneGPIO extensions to be active at a time.
    • The ability to remotely control a Raspberry Pi from a Windows, Mac, or Linux computer.
  • The Scratch blocks were refactored for ease of use.
    • The Connect block was removed, and connecting to the extension servers is now handled automatically without explicit user interaction.
    • Setting GPIO pin modes, such as input, output, and PWM is now handled automatically within the command and reporter blocks.
    • Block text was changed but is not yet finalized.
  • Cursory testing of the Arduino, ESP-8266, and Raspberry Pi extensions is complete.

A Separate Extension For Each Board Type

Each board type now has an extension of its own, and all are accessible from the web in a single Scratch 3 editor.

Note that these are “unofficial” Scratch 3 extensions. The link above is not part of the official Scratch 3 release, but are built from the latest versions of the Scratch 3 source code provided by the Scratch Team. Note also that the servers that connect an extension to its associated hardware have not yet been released. The servers are fully functional, but they are being refactored to make them more user-friendly for easy start-up. They should be available for use by the time the next posting is published.

One of the advantages of having separate extensions is that more than one board can be supported at a time. You can then create a Scratch script that uses input data from one board to affect the devices on another. For example, and this has been tested, one can monitor a push button switch connected to an Arduino, and when the button is pushed, an LED on a Raspberry Pi lights up. Release the switch, and the LED extinguishes.

For the Raspberry Pi, one has the option to control its GPIO pins either by running Scratch 3 directly on the Raspberry Pi or running Scratch 3 remotely on a Windows, Mac, or Linux computer.

Refactored Scratch Blocks

The Scratch blocks were refactored to be simpler to use. Pin modes are set automatically when any of the blocks are executed. The Connect block was removed, and connection to the board specific servers is now performed automatically.

Block text was modified but has not been finalized.

The Arduino Blocks

The ESP-8266 Blocks

The Raspberry Pi Blocks

Testing

All three supported boards, the Arduino Uno, ESP-8266, and Raspberry Pi have been tested, but have not been stressed. All blocks worked with all boards as expected.

Upcoming Goals

  • Completion of the board-specific connection servers.
  • Provide on-line documentation for installation, use, and theory of operation for the OneGPIO extensions.
  • Investigate providing integrated block text translations.