📜 ⬆️ ⬇️

As we with third-graders programmed the address garland



In hackspace, we do quite a lot with schoolchildren, but mostly they are advanced high school students. With them, quite simply, they are, in general, almost like students. Last year I wanted to expand my competence, try something more difficult.

Under the cut there will be a story about how I made friends with the address RGB garland with arduin, arduina with Scratch, and Scratch with junior high school students.

Prehistory


In the previous series I have already described a little school in which I mainly teach. After strong high school students, I first decided to take up the eighth (now already the ninth) class, but it surprisingly turned out to be absolutely none, it is not often possible to meet schoolchildren who are not interested in this way. For the ninth grade is the fifth, as the oldest is very strong. However, the fifth one is another story; it is almost impossible to learn how to write code; we need a graphical programming environment. Actually, this is where the interesting begins.
')

Initial data


Address LED RGB garland 50PCS WS2801 :

image

For those who have not encountered: each light bulb in it - these are three LEDs and a chip that receives commands using the SPI protocol and lights the corresponding LEDs.

Arduino Uno:

image

Scratch graphic programming environment:

image

Probably for good, all this had to be done on ArduBlock, but at that moment it seemed to me that the Scratch was much faster.

Fifth grade - 14 people (I will not upload a photo).

The easiest way was to connect arduin to the garland; there is a special library: github.com/adafruit/Adafruit-WS2801-Library
Next, you need to write a script that will process the commands on the serial port from the computer and light the garland. There was a problem here: when submitting a long enough string, the garland would not like to light up with the desired color. I somehow managed to overcome this by shamanism, but I didn’t understand what the problem was (I won’t post the code, because I don’t understand how it works).

Next, it was necessary to make friends with the serial port with Scratch. Scratch can write to a socket using UDP protocol (among graphic blocks there is a “broadcast” block to which a string can be sent), and this is the only way to get a text string from it. I decided to write an adapter on python, which would read lines from the corresponding port, save to the buffer and send it to the serial port at intervals. There are good libraries for this: github.com/pilliq/scratchpy - for interacting with the scratch, the serial library (coming out of the box) - for the serial port.

So, we’ve got a bit buggy, but in general, a working graphical environment for controlling the garland:



Next you need to explain to children how to use it. I don’t like to explain something at all, but I love it when the children read the training manual and do everything themselves. Actually, I wrote such a training manual : docs.google.com/document/d/1XdhVsTQvrjNnEUoqMiRrYoqEJPDo2HTAs6YYHc0dJag/edit

In fact, they study there the following:
  1. Working with graphic environment: how to drag blocks, which block is responsible for what.
  2. How to set numbers in RGB format.
  3. Cycles
  4. Work with variables
  5. Work with arrays (for ignition of a garland we send it an array, each element of which is a color with which the light bulb should light up)

What is the result?


At first, full of delight, two children sat without stopping, even the girls, only exclamations came: “Oh, she lit up!” An applied task appeared to our luck - to make the scenery for a school theatrical production: a fire, a starry sky, an iridescent ruby. Now we are doing this, it seems interesting.
The main problem I encounter is that children remember very poorly what they did in the last lesson, each time they have to scroll back through the training manual a few pages back and repeat everything. How to deal with this is not yet understand. You can, of course, force them to do a lot of tasks of the same type in order to be remembered well, but at the same time their motivation drops.

In the process, it turned out that the girls like an ordinary Skretchevsk cat like more than a garland, so they are now working on my usual course without any glands.

After the fifth grade I took another third, with him in general everything is the same. In general, the experience is very good, now I know that even for classes with undergraduates there is no need for special pedagogical abilities, you only need to give them an interesting subject for study, and they will do everything themselves.

Source: https://habr.com/ru/post/253393/


All Articles