Labs / Bipes + MicroPython

2 Usage of Basic Programming Building Blocks

Author: Li Zisheng · Source: FreakStudio open documentation · License: CC BY 4.0

Young creators, in the last chapter we got to know the "Magic Workbench", and also learned that there is a "Magic Block Box" full of instructions hidden inside the workbench — that's the Blocks Area! Today, we are going to unlock the most core "mini tools" from this block box — Basic Blocks! Essentially, these blocks are the most core "mini tools" in the Magic Workbench, and they are the core helpers for us to write programs~

Just as we need basic tools like scissors, glue and colored paper for handicrafts, writing a program also requires these fundamental building blocks selected from the "magic block box" as "little helpers". They are the "basic skills" of programming; with them, our programs can become capable of "thinking, repeating tasks, calculating and memorizing", instead of simply "doing things in sequence"!

You might be wondering, "What exactly can these building blocks help us do? " Let me give you a few super simple examples:

Isn't that amazing? With these basic building blocks under our belt, we can write smarter, more flexible programs to accomplish all sorts of fun yet simple tasks, such as an "automatic temperature-controlled night light", a "button-activated counting toy", and many more~

Next, just like picking new friends from a "magic block box", we will unlock these commonly used basic blocks one by one: logic blocks, loop blocks, math blocks, text blocks, list blocks and variable blocks. Each of them can be found in the block area we mentioned in Chapter 1, and they are all very simple. Follow the teacher to learn step by step, and you will soon learn how to use them!

A Little Encouragement: These basic blocks unlocked from the "Magic Block Box" are the foundation of programming, just like how you need to master addition, subtraction, multiplication and division first when learning math~ Learn each one carefully, and later we can combine them to write super cool programs!

Interactive Quick Quiz

  1. Think about it: What do you usually do that requires "repeating many times"? (For example: skipping rope 10 times, copying new characters 5 times) If you want to implement this with a program, which basic block do you need to help? (Hint: the loop block!)
  2. Quick Quiz: What type of blocks does a program need to use when it wants to "decide whether to do something"? (Answer: Logic judgment blocks!)