Robot Karol: creating commands

instagram viewer

With the Robot Karol you can get a simple insight into the programming world, whether young or old. But which commands can be used to control the robot and which programming language does it react to?

You can't program real robots yet, but it works with Karol.
You can't program real robots yet, but it works with Karol.

Basics of Robot Karol

  • The Karol robot is waiting for your instructions. So in order to get it to work automatically without the remote control via buttons, you have to create commands for it. These can be of many types, but the basics for creating them are always the same.
  • When the program is open, you will see an editor on the left above the three-dimensional world and the robot, in which you have to enter your commands. When you have entered a sequence of commands, you have programmed a program for the Karol robot.
  • You have to know that the command that is ultimately in the first line of the window is also the first to be executed by Karol. For a sequence of commands and thus for programming, you always need a complete line-by-line Enter command and can only continue with the next command if the previous one is also error-free runs.
  • Do you want to restore the original state of Karol's world to a new command sequence program, then go to Karols Welt with the left mouse button and press the L key.

The commands explained in detail

  • In the end, Robot Karol knows 6 basic commands: wait, run, put down stones, turn right and left and lie down. In addition, he can set marks, cancel marks and play a sound.
  • Programming a script - this is how it works

    Anyone who has ever wanted to simplify working on the computer has definitely chosen ...

  • If you now enter "Step" in the first line of the editor and press F9, Karol takes a step. If you want him to take several steps, start a new line in the editor for each word "step".
  • If you want Karol to take a step and then wait, enter "Step" in the first editor line and "Wait" in the second a, Should he then go in a different direction, write in the third line either Turn Left or Turn Right.
  • To place a stone, write down in the editor, a space and then, in brackets, the number of stones that it should put down. It works the same way when picked up.
  • If Karol is not to place or remove stones, but rather a mark, then markSet to set and markDelete to delete must be entered in the corresponding editor line.
  • Finally, respond to the wait command. So if you want to make Karol wait, write Wait in the editor line, with a through Brackets separated by spaces from the command must enter the number of milliseconds that Karol will wait target.
  • You now have "Step" in the first line, "Turn Left" in the second and in the third "Lie down (6)" and go to F9, Karol will execute a sequence of commands that you have programmed to have. It only stops executing with the "Exit" command.

How helpful do you find this article?

click fraud protection