AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

Typing for the micro:bit

Week 7 · Unit 7.2: Decomposing problems · 3 lessons
Answers are for parents and teachers.
1
Write a MicroPython program that scrolls your first name and then shows a heart.
2
Find four mistakes in this program and write the correct version.
Python
1from microbit import *
2while True
3    if button_a.is_pressed
4        display.show(Image.no)
3
Write a program with two buttons: when A is pressed, scroll the word Up; when B is pressed, scroll the word Down.
4
Explain the difference between a syntax error and a logic error. Give one example of each for a micro:bit program.
5
Predict what the program does when you press A briefly and release it.
Python
1from microbit import *
2while True:
3    if button_a.is_pressed():
4        display.show(Image.YES)
5        sleep(2000)
6        display.show(Image.SQUARE_SMALL)