Mighty Microbit Basic
latest
  • Lesson 1 beautiful image lesson
  • Lesson 2 lucky 7 blocks lesson
  • Lesson 3 answering machine blocks lesson
  • Lesson 4 game of chance blocks lesson
  • Lesson 5 smiley blocks lesson
  • Lesson 6 magic logo lesson
  • Lesson 7 snowflake fall blocks lesson
  • Lesson 8 screen wipe blocks lesson
  • Lesson 9 flashing heart blocks lesson
  • Lesson 10 blink blocks lesson
    • Topic
    • Quick links
      • blink blocks activity
      • blink blocks quiz
      • blink blocks quiz answers
      • blink blocks challenges
        • Before we get started
        • Challenge 1
        • Challenge 2
        • Challenge 3
        • Challenge 4
        • Challenge 5
    • Prior learning / place of lesson in scheme of work
    • Documentation
    • Objectives
  • Lesson 11 night light lesson
  • Lesson 12 game counter lesson
  • Lesson 13 happy birthday blocks lesson
Mighty Microbit Basic
  • Docs »
  • Lesson 10 blink blocks lesson »
  • blink blocks challenges
  • Edit on GitHub

blink blocks challenges¶

Coding challenges for the blink tutorial

Before we get started¶

Complete the blink activity and your code will look like this:

basic.forever(() => {
    led.plot(2, 2)
    basic.pause(500)
    led.unplot(2, 2)
    basic.pause(500)
})

Challenge 1¶

Let’s display a “smiley face” on the screen! We’ll start by plotting the eyes.

Add plot(1,1) and plot(3,1) under plot(2,2) ; then add unplot(1,1), unplot(3,1) and unplot(2,2) after pause. When you’re ready, don’t forget to run your code to try it out!

basic.forever(() => {
    led.plot(2, 2)
    led.plot(1, 1)
    led.plot(3, 1)
    basic.pause(500)
    led.unplot(2, 2)
    led.unplot(1, 1)
    led.unplot(3, 1)
    basic.pause(500)
})

Challenge 2¶

Let’s add the code to plot the mouth by using plot and unplot to the following coordinates: (1,4), (2,4) and (3,4). When you’re ready, don’t forget to run your code to try it out!

basic.forever(() => {
    led.plot(2, 2)
    led.plot(1, 1)
    led.plot(3, 1)
    led.plot(1, 4)
    led.plot(2, 4)
    led.plot(3, 4)
    basic.pause(500)
    led.unplot(2, 2)
    led.unplot(1, 1)
    led.unplot(3, 1)
    led.unplot(1, 4)
    led.unplot(2, 4)
    led.unplot(3, 4)
    basic.pause(500)
})

Challenge 3¶

Let’s keep using plot to convert the mouth into a smiley face.

0 0 0 0 0
0 1 0 1 0
0 0 1 0 0
1 0 0 0 1
0 1 1 1 0

Challenge 4¶

Let’s make it blink a bit faster. To do so, we need to reduce the amount of time used in pause to 100 milliseconds.

Challenge 5¶

Create your own image by changing the coordinates in plot and unplot!

Next Previous

© Copyright 2018, sean Revision faf697ce.

Built with Sphinx using a theme provided by Read the Docs.