test

test

ROBOTICA, GAMES, ANIMATIES, KUNST EN MEER!


Leer op een leuke en creatieve manier programmeren met Scratch en Lego WeDo, de mBot, de BBC micro:bit en Makey Makey!

Op deze blog vind je lesmateriaal en workshopideeën van PinkyPepper, alias Martine Segers. Zij is ook in te huren voor het maken van lesmateriaal op maat en het geven van workshops in Den Haag en omgeving.


Code for wooden robot with butterfly and Lego figure

As requested I hereby share the code of my wooden robot, as shown on this photo:



This is the code for the remote control micro:bit. It sends a signal through the radio function to steer the robot and to make it do things like cheering and waving.



The next code is for the wooden robot itself. In the block called "on start" the robot is told to show what the butterfly and Lego figure can do.

In the forever block the robot is told what to do when it receives a certain number from the other micro:bit.

To keep steering possible, this code needs to call the function "check radio" a lot! Otherwise, you can't change the direction of the robot while the butterfly is "flying" for example.

This makes the code more complicated than I had hoped and difficult for younger children to understand, I am afraid.

I am used to Scratch which seems to be able to handle way more things at the same time than the Javascript blockeditor, at least it can do this with code that is way easier to understand for kids.

But if anyone knows a way to simplify my code, I would love to hear it!

The code is divided into 4 .png images, otherwise the resolution became very low. You can click on each png image to enlarge it.



If you have any suggestions or questions, you can reach me at PinkyPepper.Scratch @ gmail.com or at @PinkyPepper_ on Twitter. If you send me an e-mail, I can send you the .hex file of my code if you like.