Discuss Scratch
- Discussion Forums
- » Connecting to the Physical World
- » Just released s2a_fm - a hardware extension for Arduino/Scratch Integration
- itchy20
- Scratcher
100+ posts
Just released s2a_fm - a hardware extension for Arduino/Scratch Integration
Last edited by itchy20 (Jan. 1, 2014 18:44:01)
- phuongle
- New to Scratch
1 post
Just released s2a_fm - a hardware extension for Arduino/Scratch Integration
https://github.com/MrYsLab/s2a_fm.The link isnot available, please provide another, thanks You can down load at .
- rb1000
- Scratcher
7 posts
Just released s2a_fm - a hardware extension for Arduino/Scratch Integration
Try this one: s2a_fm
- rb1000
- Scratcher
7 posts
Just released s2a_fm - a hardware extension for Arduino/Scratch Integration
oops
https://github.com/MrYsLab/s2a_fm
https://github.com/MrYsLab/s2a_fm
- sdmeijer
- Scratcher
100+ posts
Just released s2a_fm - a hardware extension for Arduino/Scratch Integration
https://github.com/MrYsLab/s2a_fm.The link isnot available, please provide another, thanks. You can down load at
Just remove the dot at the end of the URL ;-)
- scratchisthebest
- Scratcher
1000+ posts
Just released s2a_fm - a hardware extension for Arduino/Scratch Integration
Looks neat!
I am a Lava Expert
- itchy20
- Scratcher
100+ posts
Just released s2a_fm - a hardware extension for Arduino/Scratch Integration
Original link is fixed and now works. Sorry about the extra period.
- RichardDL
- Scratcher
16 posts
Just released s2a_fm - a hardware extension for Arduino/Scratch Integration
This looks very good but I'd like some help getting it running. I have Scratch 2.0 downloaded and open. I think I have to add s2a_fm.s2e - how? I have Arduino + IDE all working, that must need to run Firmata - which one? Anything else?
- sdmeijer
- Scratcher
100+ posts
Just released s2a_fm - a hardware extension for Arduino/Scratch Integration
This looks very good but I'd like some help getting it running. I have Scratch 2.0 downloaded and open. I think I have to add s2a_fm.s2e - how? I have Arduino + IDE all working, that must need to run Firmata - which one? Anything else?
In the documentation folder on GitHub (https://github.com/MrYsLab/s2a_fm/tree/master/documentation) you can find all the information you need.
Please read this first.
If you stil have questions, please post them here and I'll try to help you.
- RichardDL
- Scratcher
16 posts
Just released s2a_fm - a hardware extension for Arduino/Scratch Integration
Alright thanks. I'm reading…
- RichardDL
- Scratcher
16 posts
Just released s2a_fm - a hardware extension for Arduino/Scratch Integration
I'm working on Windows XP. I've been using Scratch 1.4 for years, new to 2.0 and I'm familiar with Arduino. I know very little about python and this seems to be the problem.
I have s2a_fm_base.sb2 and Turn+On+LED+On+Pin+6.sb2. I've downloaded and installed Python. Downloaded PySerial and PyMata, NewPing. Python runs -> “Idle”, but I'm failing to “install” PySerial or PyMata. I downloaded pip (text) and ran it in Python window. Cmd window does not accept ‘python’ or ‘pip’. Serial is in C:\Programs\Python33\Lib\site-packages\serial, Pymata is in C:\Downloads\Downloads_6\PyMata-master\PyMata-master.
I have s2a_fm_base.sb2 and Turn+On+LED+On+Pin+6.sb2. I've downloaded and installed Python. Downloaded PySerial and PyMata, NewPing. Python runs -> “Idle”, but I'm failing to “install” PySerial or PyMata. I downloaded pip (text) and ran it in Python window. Cmd window does not accept ‘python’ or ‘pip’. Serial is in C:\Programs\Python33\Lib\site-packages\serial, Pymata is in C:\Downloads\Downloads_6\PyMata-master\PyMata-master.
- sdmeijer
- Scratcher
100+ posts
Just released s2a_fm - a hardware extension for Arduino/Scratch Integration
I've send Alan (the maker of s2a_fm) an e-mail, asking him to help you with it.
- itchy20
- Scratcher
100+ posts
Just released s2a_fm - a hardware extension for Arduino/Scratch Integration
Hi RichardDL,
This is explained in the documentation that comes with s2a_fm, but I will take you through it step by step here.
I am assuming that you have downloaded the StandardFirmata sketch into your Arduino. Leave the Arduino board connected to your computer.
1. You will need to install Python if you do not have that already installed. Go to Python.com and download the correct .msi installer for windows (they have a 32 bit and 64 bit installer - pick the one appropriate one for your copy of XP).
2. After python is installed, you will need to download and install the pyserial library. Go to this link to install pyserial
3. Create a directory on your computer and then download PyMata and s2a_fm by clicking on the following links. Make sure you place the zip files in the directory you created and then unzip both zip files.
s2a_fm
PyMata
4. After you downloaded and unzipped PyMata, cd into the PyMata-master directory and type:
python setup.py install
5. Finally, with the Arduino plugged into your computer, and StandardFirmata installed, cd to the s2a_fm-master directory you created in step 3, type the following in a command window:
./s2a_fm.py
You may have to change the permissions on s2a_fm.py if windows complains not being able to execute the file.
If all was installed successfully, you should see some information appear in the command window with the last line telling you to start Scratch or Snap!.
6. Start up Scratch (off-line version) and press shift-file. Select “Import Experimental Extension” Go to the s2a_fm-master/ScratchFiles/ExtensionDescriptors directory in the file chooser, and select s2a_fm.s2e for blocks in English, or s2a_fm_Es.s2e, for blocks in Spanish, or s2a_fm_NL.s2e for blocks in Dutch.
7. In Scratch, click on the More Block tabs, and the s2a_fm blocks should be visible.
The next time you want to start s2a_fm, make sure that you have your Arduino board plugged into your computer with StandardFirmata (or one of my variants) loaded onto the board, and repeat steps 5, 6 and 7.
I hope this answers your questions. If you need any additional help you can always send an email to (removed by moderator - please don't share contact information)
This is explained in the documentation that comes with s2a_fm, but I will take you through it step by step here.
I am assuming that you have downloaded the StandardFirmata sketch into your Arduino. Leave the Arduino board connected to your computer.
1. You will need to install Python if you do not have that already installed. Go to Python.com and download the correct .msi installer for windows (they have a 32 bit and 64 bit installer - pick the one appropriate one for your copy of XP).
2. After python is installed, you will need to download and install the pyserial library. Go to this link to install pyserial
3. Create a directory on your computer and then download PyMata and s2a_fm by clicking on the following links. Make sure you place the zip files in the directory you created and then unzip both zip files.
s2a_fm
PyMata
4. After you downloaded and unzipped PyMata, cd into the PyMata-master directory and type:
python setup.py install
5. Finally, with the Arduino plugged into your computer, and StandardFirmata installed, cd to the s2a_fm-master directory you created in step 3, type the following in a command window:
./s2a_fm.py
You may have to change the permissions on s2a_fm.py if windows complains not being able to execute the file.
If all was installed successfully, you should see some information appear in the command window with the last line telling you to start Scratch or Snap!.
6. Start up Scratch (off-line version) and press shift-file. Select “Import Experimental Extension” Go to the s2a_fm-master/ScratchFiles/ExtensionDescriptors directory in the file chooser, and select s2a_fm.s2e for blocks in English, or s2a_fm_Es.s2e, for blocks in Spanish, or s2a_fm_NL.s2e for blocks in Dutch.
7. In Scratch, click on the More Block tabs, and the s2a_fm blocks should be visible.
The next time you want to start s2a_fm, make sure that you have your Arduino board plugged into your computer with StandardFirmata (or one of my variants) loaded onto the board, and repeat steps 5, 6 and 7.
I hope this answers your questions. If you need any additional help you can always send an email to (removed by moderator - please don't share contact information)
Last edited by Paddle2See (Dec. 4, 2015 00:15:17)
- itchy20
- Scratcher
100+ posts
Just released s2a_fm - a hardware extension for Arduino/Scratch Integration
Left out one thing - if you are using StandardFirmata, it will not support NewPing. If you want to use NewPing, you will need to install that library for Arduino following the instructions on the Arduino site, and then install FirmataPlus instead of StandardFirmata which can be found in s2a_fm-master / ArduinoFiles / FirmataPlus / examples / FirmataPlus /
- chrisnolan
- Scratcher
15 posts
Just released s2a_fm - a hardware extension for Arduino/Scratch Integration
We gave it a try today too. It was unexpected to have to dig through folders to find documentation, I read the README and figured it would have what I needed. Perhaps if you add a mention in the read me to the other docs, and maybe a bit of detail as to the other folders too. The reference pdf was detailed enough and we got it all connected fairly straight forward after that. For some reason I was expecting it to be more like the arduino IDE where we were uploading our code to the board, and maybe reading the serial port back for the information. The Firmata stuff I hadn't come across before in my limited arduino experience but was fun.
My son and I threw together a little LED and potentiometer setup where the LED dims and scratchy points in the direction of the dial. Video @ https://www.youtube.com/watch?v=8KxAJDBxD3U
One error we had was we sent floats to the python routine and it was expecting an integer and it errored – the server kept going but it took me a minute or two to notice the constant stream of errors in the terminal window and the LED only working on 0 and 255 and none of our in-between values. A round in scratch solved the problem, but might want to catch it on your end too?
My son and I threw together a little LED and potentiometer setup where the LED dims and scratchy points in the direction of the dial. Video @ https://www.youtube.com/watch?v=8KxAJDBxD3U
One error we had was we sent floats to the python routine and it was expecting an integer and it errored – the server kept going but it took me a minute or two to notice the constant stream of errors in the terminal window and the LED only working on 0 and 255 and none of our in-between values. A round in scratch solved the problem, but might want to catch it on your end too?
Last edited by chrisnolan (March 10, 2014 01:47:00)
- chrisnolan
- Scratcher
15 posts
Just released s2a_fm - a hardware extension for Arduino/Scratch Integration
- itchy20
- Scratcher
100+ posts
Just released s2a_fm - a hardware extension for Arduino/Scratch Integration
@chrisnolan Thanks for the feedback. I will be updating s2a_fm in the next couple of weeks with a French and Chinese translation (in addition to the Dutch and Spanish translations already in place), and will place a pointer to the documentation on the readme - good suggestion. I will also look at the possibility of doing some additional data validation, but the documentation (if one can find it ) does describe the valid values - not an excuse, we will revisit this. In the future, if things are not acting as expecting, check the log files (or the console) and it may provide some useful information. You can also turn on debugging for additional information. I was glad to hear that the program worked as expected - throwing out non-valid input and continuing to accept data.
- megakuku
- Scratcher
9 posts
Just released s2a_fm - a hardware extension for Arduino/Scratch Integration
I'm using the offline editor v385 on Windows 8.1. When I load s2a_fm (or any other extension) the editor totally freezes after some time (“Scratch 2 Offline Editor is not responding”)
Did anyone of you experience this issue?
Did anyone of you experience this issue?
- chrisnolan
- Scratcher
15 posts
Just released s2a_fm - a hardware extension for Arduino/Scratch Integration
I'm using the offline editor v385 on Windows 8.1. When I load s2a_fm (or any other extension) the editor totally freezes after some time (“Scratch 2 Offline Editor is not responding”)
Did anyone of you experience this issue?
I experienced it a couple of times but never while I was coding so didn't lose anything. I attributed it to Scratch trying to connect to the extension and not finding it waiting as it happened only after I reopened the program to take screen shots of the code.
- itchy20
- Scratcher
100+ posts
Just released s2a_fm - a hardware extension for Arduino/Scratch Integration
@megakuku
Most likely you are hitting one of several bugs within Scratch's hardware extension code. If you send a copy of your .sb2 to [Removed - please don't share contact info] I would be happy to take a look. You might want to check out Snap! which is much more stable than Scratch in terms of the hardware extensions.
Most likely you are hitting one of several bugs within Scratch's hardware extension code. If you send a copy of your .sb2 to [Removed - please don't share contact info] I would be happy to take a look. You might want to check out Snap! which is much more stable than Scratch in terms of the hardware extensions.
Last edited by Harakou (Dec. 5, 2015 01:04:35)
- Discussion Forums
- » Connecting to the Physical World
- » Just released s2a_fm - a hardware extension for Arduino/Scratch Integration