microbit RS
enkel microbit

Why micro:bit?

People who want to learn programming often ask which language they should learn first. I think MakeCode and the micro:bit is a fantastic way to learn to program because you’re not just programming on the screen but you can write programs that use the micro:bit sensors’ real data and respond to movement, light level, and gestures. It’s also really very easy to program the micro:bit if you’re using the MakeCode blocks, but you can also see the JavaScript code so that you can get an idea of what formal JavaScript looks like. 

You can also do most of the programming exercises in this book though you do not have a micro:bit, because the simulator in MakeCode shows you exactly what the output will look like. The micro:bit doesn’t cost much, and the MakeCode software is free.

The micro:bit “Club bundle” contains 10 micro:bits with 10 USB cables , 10 battery holders and 20 x AAA Batteries or you can buy individual micro:bits.

Available from for example  RS-online   or   Pishop.co.za  or   Deftech,  at prices ranging from R199 to R400 each.

The latest version of micro:bit, V2, is backwards compatible with previous version of the micro:bit as well as software and equipment. V2 has more memory and a CPU upgrade, a higher power output of 200mA to accessories and the edge connectors have small indentations to stop clips slipping off.

Workbooks are available at www.textbooks4u.co.za.  Bulk discount and free training on Zoom for teachers who order our books for their classes.

Year plan

These lesson take about  90 minutes to complete. Each lesson explains new concepts and then learners have to write five or more programs.  Learners need enough time to experiment and gain confidence. Depending on the amount of class time available, each lesson will be completed in one to 3 weeks.

Lesson 1


MakeCode interface

During this lesson you will learn

  • how to open MakeCode,
  • how to create a new project,
  • the screen layout,
  • how to save your project, and
  • how to open an existing project.

Lesson 2

The micro:bit

During this lesson you will learn

  • that a micro:bit is a small computer and
  • which built-in components the micro:bit has:
    • CPU and RAM
    • light sensor, accelerometer
    • Bluetooth/radio
    • Temperature sensor
    • USB-port and 
    • JST battery prop
    • buttons

Lesson 3

The blue blocks in the Basic group​

During this lesson you will learn

  • about two data types: numbers and strings
  • how to use several blue blocks from the “Basic” group in MakeCode to display numbers, words, and pictures on the micro:bit’s screen and
  • how to use the Help feature for blocks so that you can test out on your new blocks. Do not be afraid to experiment.
  •  

Lesson 4

Flash a program to the micro:bit

During this lesson you will learn

  • connect the micro:bit to the computer,
  • transfer the hex file to the micro:bit,
  • use the micro:bit with batteries.

Lesson 5

The pink C-blocks

During this lesson you will learn

  • learn how to use the C-block that executes when the user presses button A,
  • learn how to use the C-block that executes when the user presses button B,
  • learn how to use the C-block that executes when the user presses button A and B simultaneously,
  • learn how to use the “gesture” C-blocks “on Shake,”on tilt”,”on 3g/6g/8g “,”on logo up/down”and”On faceup/down”used
  •  
  •  

Lesson 6

Sensor readings

During this lesson you will learn

To read and display

  • acceleration
  • light intensity
  •  temperature
  • tilt, direction and
  • deviation of north

Lesson 7

Variables

During this lesson you will learn

  • what a variable is,
  • how to select a name for a variable,
  • how to choose a data type for variables,
  • how to create variables,
  • how to set values in variables, and
  • how to increase or decrease the value of the variables.
  •  

Lesson 8

IF-ELSE choices

During this lesson you will learn

  • what condition blocks are,
  • which symbols you can use in condition blocks,
  • how to use the IF-then blocks with condition blocks,
  • how to use the If then else logical choice blocks with condition blocks.

Lesson 9

Choices with more than one condition

During this lesson you will learn

    • how to combine more than one condition with AND and OR,
    • how to use the True/False data type
    • how to use IF Else for many options
  •  

Lesson 10

Random numbers

During this lesson you will learn

  • how to select a random number from an interval of numbers by using the random block from the Math Group
  • how to randomly select True or false by using the random block from the Math Group

Lesson 11

Math Calculations

During this lesson you will learn

  • how to use parameters with valid arguments,
  • how to use “Math” blocks to add, subtract, multiply and divide numbers
  • how to use more than one Math block, keeping the correct order of operation in mind.
  •  
  •  

Lesson 12

Math Functions

During this lesson you will learn

How to use built-in mathematical function blocks in MakeCode to

  • calculate the square root of a number,
  • round down decimal numbers to the nearest integer,
  • calculate the maximum and minimum of two numbers and
  • determine the remainder when you divide an integer by another integer and
  • how to use the “join” function to combine text strings.
  •  

Lesson 13

Control the LEDs with code

During this lesson you will learn

  • what an array is and
  • how to use the LED blocks In MakeCode to plot output on the micro:bit screen.
  •  

Lesson 14

Loops

During this lesson you will learn

  • how to use the light green “loop” blocks in MakeCode to perform blocks repeatedly,
  • how to build a string by adding to the string in a loop and
  • how to calculate the maximum and minimum, total, and average of many numbers within a loop.
  • two types of loops

Lesson 15

Nested loops

During this lesson you will learn

  • how to use the light green loop blocks nested in each other.
  •  

Lesson 16

Built-in Music

During this lesson you will learn

  • how to use the Music-blocks in Makecode to play sound through the micro:bit on your headphones.
  •  

Lesson 17

Write music

During this lesson you will learn

  • How to use the play tone blocks in MakeCode to write songs
  •  

Lesson 18

User-written functions

During this lesson you will learn

  • what a function is
  • how to write and call a function without parameters
  • how to write and call a function with one number as parameter
  • how to write and call a function with one String parameter
  •  

Lesson 19

Send and receive radio signals

During this lesson you will learn

  • about electromagnetic waves,
  • wavelength,
  • frequency, the electromagnetic spectrum, and
  • radio waves,
  • how to send and receive messages with a micro:bit with radio waves.
  •  
  •  

Lesson 20

Serial monitor

During this lesson you will learn

  • what serial signals are,
  • how to use the serial monitor, and
  • how to view radio signals from a micro:bit on the serial monitor.

Lesson 21

Bluetooth

During this lesson you will learn

  • how to install the App to code MakeCode projects on your phone or tablet,
  • what Bluetooth is,
  • how to “pair” the micro:bit with your phone,
  • how to write a MakeCode project on your phone.
  •  

Lesson 22

Game blocks and Sprites

During this lesson you will learn

  • what a Sprite is,
  • about OOP or object-oriented programming,
  • how to use the green GAME blocks in MakeCode to create sprites on the micro:bit screen and make them move.

Lesson 23

Games with more than one sprite

During this lesson you will learn

  • How to use more than one sprite,
  • how to test whether sprites touch each other,
  • how to use the built-in “score,”
  • how to use the built-in “lives,” and
  • how to use the built-in “Countdown.”
  •  

Lesson 24

Game with two players

During this lesson you will learn

  • how to split strings into substrings (shorter strings.)
  • Use more than one micro:bit and radio messages to play a two-players a treasure hunt game.
  •  
Total Page Visits: 741 - Today Page Visits: 2