If everything went well, when you click on “More Blocks” you should see something like this: Select the last item “Import experimental HTTP extension” and select the file MaplinArm.json. Open Scratch and, while pressing down the SHIFT key, click on File.You should get a message confirming that the server is running. Then, open a terminal and launch the server with python pymarash_http_server.py. Connect the arm and make sure that it is turned on.You only need two files: pymarash_http_server.py and MaplinArm.json. I’ve installed it using homebrew on Mac, on a Ubuntu machine you probably want to use apt-get. Then, execute pip install -pre pyusb to install pyUSB. Make sure that you have pip (the package manager for Python).Make sure that you have Python on your machine (I’ve tested Python 2.7).Download the off-line version of Scratch 2.0 (obviously…).Let me know if you have it running on a Windows machine): This is what you need to do to run the extension on Mac (but I suspect the steps are very similar in Linux. Again, there are several examples online using a range of programming languages, including Python, as exemplified by this Scratch extension to control Arduino boards.īy taking inspiration (i.e., by reusing) parts of code from the links above I managed to put together the extension in an hour or so. The extension mechanism for the off-line version seems simple enough: you only need to build a basic HTTP server that acts and replies to messages sent by a Scratch sketch, as described in this document. I thought that the arm could provide an interesting example for kids using the off-line version of Scratch 2.0 (and for me to learn a bit about writing Scratch extensions). There are examples online using an Xcode project on Mac and Python on a Raspberry Pi with Linux. In terms of software, in spite of what the box says, if you are happy to run a small Python program, the arm is (unofficially) compatible with more or less any operating system that can talk to a USB port, given that the protocol has been reverse engineered. Nevertheless, I think it is an interesting learning experience and a starting point for other projects (see this video to add position sensors using potentiometers: ) This means that you can only move the arm by telling a specific joint to move in a certain direction for a certain amount of time. The arm is pretty basic: it has 4 joints and a clamp to hold up to 130 g, but there are no position sensors. The arm can then be connected to a computer using a USB cable (don’t forget that it also needs 4 D-batteries!). The arm comes in a box and it needs to be assembled, something that takes approx 2.5 hours. Maplin is currently selling a robotic arm for £29.99.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |