gpt4 book ai didi

mit-scratch - Scratch 1.4 的命令行参数

转载 作者:行者123 更新时间:2023-12-04 18:35:04 24 4
gpt4 key购买 nike

我正在使用 Scratch 1.4 为 child 准备类(class)。

本类(class)是关于控制真实设备(自制交通信号灯、 retrofit 有电机、传感器等的玩具)

为了连接硬件,我使用远程传感器协议(protocol)和 RS232 接口(interface)的控制线(3 输入/3 输出,全数字)。

一切都很好,除了一些小的不便: children 必须手动完成许多步骤:

  1. 先从头开始,
  2. 加载启用远程传感器协议(protocol)并定义变量的模板项目
  3. 接受警告消息通知,远程传感器协议(protocol)已启用
  4. 启动RSP-RS232代理

我想通过从头开始我的工具来简化它,让 Scratch 通过命令行参数执行步骤 2,3,最后连接到 RSP 端口。

这可能吗?

如果没有,对于没有 Smalltalk 经验(但是其他语言如 C++)的人来说,在 Smalltalk 中实现这些参数是否困难?

谢谢!

最佳答案

好的,经过一些阅读我可以回答我的问题。

坏消息是:在 Scratch 中显然没有命令行参数将项目文件作为启动项目传递。

不过好消息是,根据自己的需要改变划痕并不难。有几个项目这样做,例如:

Scratch 4 Arduino

Scratch GPIO

这里描述了如何做: 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 normal Scratch folder into the Scratch source code folder. (The Scratch application is actually just a Squeak virtual machine, so any recent Squeak virtual machine should also work.) Also, put copy of the Squeak source code file in that folder if needed (this file is included in the zip file starting with the 1.4 source release). Finally, drop the file "ScratchSourceCode1.4.image" onto the Scratch application. The Squeak programming environment will start up, allowing you to view and modify the Scratch source code.

我能够禁用通知远程传感器协议(protocol)已启用的对话并默认在启动时启用远程传感器。花了我 2 个小时。

附言:对于那些感兴趣的人,我在这里托管我的项目:https://github.com/vheinitz/Qratzfest正如我发现的那样,我的想法并不新鲜(大约 3 年前我就曾寻找过这种可能性,但一无所获)。不同的是,代理工具适用于 PC,旨在使用任何硬件,而不仅仅是专用于专门固件化的 Arduino 或 PI。目前仅支持串行接口(interface)的控制引脚并链接到固定名称。很快它将提供将任何引脚映射到任何临时变量的可能性。

关于mit-scratch - Scratch 1.4 的命令行参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25157509/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com