Command line arguments for Scratch 1.4

I am using Scratch 1.4 to prepare a course for children.

The course is devoted to the management of real devices (self-mounted traffic lights, modified toys with motors, sensors, etc.)

I use the remote sensor protocol and RS232 control lines (3-in / 3-out, all digital) to communicate with the hardware.

Everything works fine, except for a few inconveniences: Children have to do a lot of manual steps:

  • scratching first,
  • load a template project that allows the remote sensor protocol and defines the variables
  • Accept the warning that Remote Sensor Protocol is enabled.
  • run proxy RSP-RS232

I would like to simplify it by starting from scratch my tool, have Scratch follow steps 2 and 3 using command line arguments, and finally connect to the RSP port.

Is it possible?

If not, is it difficult to implement these options in Smalltalk for someone with no Smalltalk experience (but in other languages ​​like C ++)?

Thank!

+3


source to share


1 answer


Ok, after some readings, I could answer my question.

Bad news: Scratch is clearly missing a command line argument passing the project file as the initial project.

As good as the news is, it's not hard to modify the scratch for your own use. Several projects do this, for example:

Scratch 4 Arduino

Scratch GPIO



How to do this is described here: http://wiki.scratch.mit.edu/wiki/Scratch_1.4_Source_Code

Scratch and Squeak

...

To get started, first copy the Scratch application ("Scratch.exe" or "Scratch.app") from your regular Scratch folder to your Scratch code source. (The Scratch application is actually just a Squeak virtual machine, so any recent Squeak virtual machine should work as well.) Also, place a copy of the Squeak source file in this folder if (this file is included in the zip file since 1.4 source release) ... Finally, drop the "ScratchSourceCode1.4.image" file onto the Scratch application. The Squeak programming environment will launch, allowing you to view and modify the Scratch source code.

I was able to disable the dialog notifying that the remote sensor protocol is enabled and to enable remote sensors by default. Took me for 2 hours.

PS: For those who are interested, I am posting my project here: https://github.com/vheinitz/Qratzfest As I found out, my idea was not new (I was looking for this possibility about 3 years ago, but there was nothing). What's more, the proxy tool is designed for PC and is designed to use any hardware not specifically designed for Arduino or PI firmware. Currently, only serial control pins are supported and are associated with fixed names. This will provide the ability to map any output to any Scratch variable shortly.

+4


source







All Articles