A first look at edublocks and the Micro:bit

We will look at an easy to use IDE called edublocks. Here is the blurb

EduBlocks for micro:bit is the latest edition. It’s a drag and drop code editor based on MicroPython. It includes most MicroPython features that allows you to control the onboard micro:bit features as well as external components.

You can see the editor at https://microbit.edublocks.org/

We will create a simple example that scrolls a letter depending on the button pressed, in Edublocks this example looks like this

You select a category from the left, for example Basic , find teh block you wish to use and drag the block into the main screen. As you can see these are colour coded.

Once complete you can save this as xml, export the python file and also download a hex file. To program your MIcro:bit, connect it to your computer via a USB cable and it will appear as a drive, copy the hex file and it will be downloaded to the micro:bit. Now press the A and B buttons.

As a matter of interest here is the python code that is exported from the example above

[codesyntax lang=”python”]

from microbit import *
while True:
  if button_a.is_pressed():
    display.scroll("A")
  elif button_b.is_pressed():
    display.scroll("B")

[/codesyntax]

 

A nice easy to use online environment that can export in python

Leave a Comment

This div height required for enabling the sticky sidebar
Ad Clicks : Ad Views : Ad Clicks : Ad Views :