Do you want your child to start learning electronics and programming, but don't know where to start? At what age can you start learning? I hasten to reassure you: even at 5-7 years old it is not too early if he can read Russian. Fortunately, there are now such programming languages that it is not necessary to write the code, and your child will put the program like a puzzle. I'm talking about a system like "Scratch for Arduino" that combines programming and electronics. It is a great tool to start learning with your child.
Necessary
- - computer with Arduino IDE;
- - Internet connection;
- - Arduino board;
- - USB cable for connecting Arduino to a computer.
Instructions
Step 1
First of all, you need to install the “Scratch for Arduino” (abbreviated S4A) program on your computer. To do this, go to the site https://s4a.cat and go to the Downloads section. Download the archive “S4A16.zip” (1.6 is the latest version at the time of this writing). Unpack the archive anywhere on your computer and run the installation file. Follow the instructions of the installation wizard.
Step 2
If during the installation process the program reports that it is missing an Adobe AIR component, you should install it too. Go to the download page https://get.adobe.com/ru/air, download and install, nothing complicated.
You can now proceed with the installation of S4A. Complete the installation process as usual.
Step 3
Before starting the “Scratch for Arduino” program, you need to do one more thing: download from the site, and then into the Arduino memory, the proprietary firmware from the authors of the “S4A” program, which is called “S4AFirmware16.ino”. Download link https://vps34736.ovh.net/S4A/S4AFirmware16.ino. Unfortunately, you will have to load it into the Arduino memory from under the "adult" development environment Arduino IDE. Open the downloaded file in the development environment and load into Arduino memory as usual.
Step 4
The preparations are over, now, finally, we can start the “Scratch for Arduino” program. After starting, you will see the window shown in the illustration. In the right part of the window there is an inscription "Search for a board …" After a few seconds, it should disappear - the program will detect the Arduino board and connect to it.
Step 5
If within 10 seconds the inscription does not disappear, click on the gray panel where the search is in progress, right-click and select the "Stop board search" item. Then click again and click "Select Serial / USB Port". Specify the port number assigned by the operating system to the Arduino board (can be viewed in the device manager). Search for the board again. Now it must be defined by the program. The success will be evidenced by the running numbers in the Analog0 … Analog5 fields (pickups on the analog pins of the Arduino) and the disappearance of the "Search for board" inscription.
Now you can call your child and start programming.
Let's put together a simple program from puzzle pieces that will do the following: when you press the left mouse button, light the built-in LED of the Arduino board, and when released, turn it off.
Step 6
Click the "Control" button in the upper left part of the program window. Select the "When the green flag is clicked" puzzle. Drag to the center box. Immediately select the puzzle "Always" and also drag it to the central field. Connect it to the first one (the notches should match). Select the puzzle "If … otherwise" and insert it inside the "Always" block (this will allow our program to be triggered always when the mouse button is pressed).
Now click the Move button at the top left. Drag "Digital 13 on" and "Digital 13 off", insert the first one into the upper notch, the second into the lower block "If … otherwise" (the 13th digital pin of the Arduino is connected to the built-in LED, we will light it) …
There is one last thing left: click the "Sensors" button, select the "Mouse Pressed" puzzle and insert it into the last remaining empty space in our puzzle.
Now click on the green checkbox in the upper right corner - this will launch the program. Collected puzzles should be highlighted in white.
If you now click with the mouse, you will see the LED on the Arduino board light up, and when released, it goes out. Congratulate your child on his first program!