As third-graders and I programmed an address garland

    In hackspace, we do a lot of work with schoolchildren, but mostly these are advanced high school students. It’s quite simple with them; they are, in general, almost like students. Last year, I wanted to expand my competence, to try something more difficult.

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


    In the previous series, I already described a little school, where I mainly teach. After strong high school students, I first decided to take on the eighth (now already ninth) grade, but it was surprisingly completely nonexistent, it is not often possible to meet schoolchildren who are so uninterested in anything. After the ninth grade comes fifth, as the eldest are very strong. However, the fifth one is another story, it’s almost impossible to teach how to write code, you need a graphical programming environment. Actually, this is where the fun begins.

    Initial data

    Addressable RGB LED garland 50PCS WS2801 :


    For those who have not encountered: each light in it is three LEDs and a chip that receives commands via the SPI protocol and lights up the corresponding LEDs.

    Arduino Uno:


    Scratch graphical programming environment:


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

    Fifth grade - 14 people (I will not post the photo).

    The easiest way was to connect arduin to a garland, there is a special library:
    Next, you need to write a script that will process the commands on the serial port from the computer and light the garland. Here a problem arose: when giving a sufficiently long string, the garland did not want to light up in the right color for anything. I managed to overcome this with some kind of shamanism, but I did not understand what the problem was (I will not post the code, because I myself do not understand how it works).

    Next, I needed to make friends a serial port with Scratch. Scratch can write to a socket using the UDP protocol (among the 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 in python that would read lines from the corresponding port, save it to the buffer, and send it to the serial port at intervals. Good libraries were found for this: - for interacting with scratch, the serial library (out of the box) - for the serial port.

    So it turned out a bit buggy, but in general a working graphical environment for controlling the garland:

    Next, you need to explain to the children how to use it. I don’t like to explain anything at all, but I like it when the children read the training manual and do everything themselves. Actually, I wrote such a manual :

    Essentially they learn the following:
    1. Working with the graphical environment: how to drag and drop blocks, which block is responsible for what.
    2. How to set numbers in RGB format with numbers.
    3. Cycles
    4. Work with variables
    5. Work with arrays (to light a garland, we send her an array, each element of which is a color by which a light should light up)

    What ultimately happened

    At first, complete delight, two lessons the children did not stop looking, even girls, only exclamations came: “Oh, she caught fire!” However, now that we’ve been busy for about eight hours, interest is disappearing, aimless lighting of bulbs is not so interesting. To our good fortune, an applied task appeared - to make scenery for a school theater production: a bonfire, starry sky, an iridescent ruby. Now we are doing this, it seems interesting.
    The main problem that I am facing is that the children remember very poorly what they did in the last lesson, each time I have to leaf through the instruction manual a few pages back and repeat everything. I still don’t understand how to deal with this. You can, of course, force them to do a lot of tasks of the same type in order to remember well, but at the same time their motivation decreases.

    In the process, it turned out that the girls like the ordinary scratch cat more than a garland, so they now do my usual course without any pieces of iron.

    After the fifth grade, I took a third, with him, in general, all the same. In general, the experience is very successful, now I know that even for classes with younger students you do not need special pedagogical abilities, you just need to give them an interesting subject to study, and they will do everything themselves.

    Also popular now: