Professional Documents
Culture Documents
Micromag 5
Micromag 5
Issue 5
August 2019
Links to useful
GUIDES
10 MICROPYTHON
PROJECTS
E x pl o re
M i c ro P y th o n
o f M ic r imyptlehon
aosP
nPtia ls crea te
Explore theUesesMst fle
yth on to
icro
. By Le s P ounder
me E D s
Lro:bit.
jed
ron
pa th
ct thae aBsh
BeCs som ic
MicroPython
MAKES micro:hit
PYTHON SPECIAL
THE UNOFFICIAL MICRO:BIT micromag,cc 1
micromag.cc
COMMUNITY MAGAZINE
IN THIS ISSUE Issue 5
E x pl ore
Contents
News
P4 do your :bit - New micro:bit challenge
P5 MakeCode update overview
P6 Learning with micro:bits and robotics in
Canada
P8 SOAR with Robotics
P10
P12
Thermal Pollution monitoring with Bitty Blue
micro:bit Live- First micro:bit conference M i c ro P y th o n
Features Cover Feature | P20
Cover Feature
P20 MicroPython on the micro:bit
P22 MicroPython Editors
P23 Useful MicroPython Guides + Links
P24 10 Mini MicroPython Projects
micro:bit In Schools| P14
P30 micro:hit - MicroPython Special
Makes
P32 ScaraBot EDU
P34 Toy Cars Timing Gate
P36 Texting with MicroPython
P38 Activated Art with the Hummingbird Kit
Reviews
P40 wifi:bit
P41 Inksmith K8 Robot
Hello I
t’s a pleasure to be able to welcome you on the micro:bit”. We’ve collated some great
to the all new micro:mag. Our team MicroPython powered articles for you as
World
has been at work for months to bring well as a special cover feature that has 10
you a new design and layout for the MicroPython examples to get you started.
magazine. This is a step to making micro:mag We’ve also got a special micro:hit for you that
a better magazine and it’s only possible shows you how to power a string of LEDs with
because of our amazing readers. Special MicroPython & the micro:bit.
thanks to LGFL who kindly sponsored our Alongside that, we have tons of other
move to Adobe Creative Cloud which gave great articles in Issue 5 including news about
us access to Adobe InDesign (the industry the official micro:bit conference, the launch of
standard for magazine creation). Another do your :bit, a look at the world’s first WiFi add-
special thanks must go to Chris Burkill who on for the micro:bit as well as a tutorial on how
Joshua Lowe designed the magazine for us. to build a timing gate, just to name a few.
We have another amazing Issue in store On behalf of the whole micro:mag Team,
Senior Editor for you. Issue 5’s cover feature is “MicroPython enjoy your printed copy of Issue 5!
DO YOUR :BIT LAUNCHING SOON MICRO:BIT LIVE TOY CAR TIMING GATE
After the successfull Global Challenge, The first ever official micro:bit confer- Build your own timing gate using Micro-
The Foundation is back with “do your :bit” ence is taking place in Manchester this year Python and the micro:bit.
micromag,cc 3
:NEWS do your :bit
4 micromag,cc
with
ng at educator trial kits, andeducator
Turnthe
curriculum,
et more information Get
your micro:bitTurn
micro:bit Live + Makecode
:NEWS
www.GiggleBot.io
JavaScript
MakeCode
EduBlocks
GiggleBot!
Python
micro:bit LIVE
on projects
into ayour
Turnyour
yourmicro:bit
micro:bitinto
intoaarobot
robotwith
withthe
the
more information
Turn
Start
GiggleBot!
purchasing
GiggleBot!
5 minutes!
robot
Startcoding
Start codingin
inunder
under55minutes!
minutes!
micro:bit
MakeCode
MakeCode
with the
www.GiggleBot.io
trialatkits, and purchasing at
JavaScript
MakeCode
EduBlocks
GiggleBot!
EduBlocks
EduBlocks
Python
JavaScript
on projects and curriculum,
JavaScript
Getmore
Get moreinformation
informationon onprojects
projectsand
andcurriculum,
curriculum,
educatortrial
educator trialkits,
kits,and
andpurchasing
purchasingatat
www.GiggleBot.io
www.GiggleBot.io
MakeCode Update
T he MakeCode editor
from Microsoft is the
most popular way to program
Green Screen is a cool
new feature that will allow you
to overlay your webcam onto
Last but not least, the new
Convert to text block allows
you to convert different data
the micro:bit and is packed full the MakeCode workspace. This types into text!
of features that make it easy allows you to demonstrate code We love seeing these new
to use. Recently the MakeCode and hardware at the same time! features being added to Make-
team have released a new The new My Projects view Code as it opens up a range of
update with some awesome – Also one of the top requested brand new possibilities. You can
new features. Let’s see what’s features gives you the ability to see the update at
in store. see all your projects, and then makecode.micro.bit.org
Functions with Parameters open, delete, and duplicate the
is ine of the exciting new projects.
features in this update. Tutorials now save your
According to Microsoft, this progress so you can jump back
is one of the most requested into where you left off.
features as of lately. Now when The Servo Blocks have
you make a function, you have been updated, they now help
the option to add Text, Boolean you calibrate your servos and
or Number type parameters. give you better control.
micromag,cc 5
:NEWS Fair Chance Learn
Learning with
micro:bits
and robotics
in classrooms
across Canada Fair Chance Learning and InkSmith have teamed up to
BY Fair Chance Learning
bring the micro:bit-powered robot, k8, and curriculum
connected professional learning to Canadian classrooms.
6 micromag,cc
Fair Chance Learn
:NEWS
micromag,cc 7
:NEWS SOAR With Robotics
SOAR WITH
ROBOTICS
Working with trees and bees using Drones, Apps, and micro:bits.
By Robin McKean.
D
rone Pilot Training, with simulated interested in using digital technologies to code, create
About the Author
helicopter rescues and environmental and connect with the real world. The TCC SOAR with
flight missions, has ‘taken off’ with Robotics program has been inspired by the range of
micro:bits, Game Controllers and
unique digital solutions generated by children around
Inventor’s Kits from the National Lending Library
the world who participated in the micro:bit Global
of the Computer Science Education Research
Group (CSER) at the University of Adelaide. Challenge. It emulates similar actions undertaken by
Students are SOARing with Robotics as they our local Millennium Kids (MK Inc) – young problem
undertake sustainability assignments, and as young solvers, innovators and change agents. MK Kids are
Digital Technologies
Project Officer with inventors - design, build and test working models SOARing with their #1000actionsfortheplanet, Green
at the University of of quadcopters and submersibles. Trainees are
Adelaide; Millennium Lab Projects and the MK Kids On Country Project.
earning their drone pilot wings as they work through
Kids Inc Council - When On Country, Kids from Coolgardie, with their
squadron ranks from Safety and Junior Flight Officer
working shoulder to
to First Officer, Captain and the highest-ranking Top traditional elders and MK volunteers, travel to remote
shoulder and face to
face with teachers and Gun – Engineer. areas in the Great Western Woodland to learn about
students to integrate
Squadron Leaders from TCC- Thornlie Christian their traditional language and culture while monitoring
digital technologies for a
sustainable future. College, have joined forces with the CSER Digital the wellbeing of the bushland using both traditional
Technologies Project Officer from the University of and newer drone and micro:bit technologies.
Adelaide to design and facilitate a hands-on FUN CSER Lending Library Kits contain a selection
Twitter: @rmckean of accessories, including Mini Buggy and Kitronik
middle years extracurricular program for students
8 micromag.cc
SOAR with Robotics
:NEWS
andServo:lite
Inventor’s kits, bulldozer, Bumper and Servo:lite modules, and 12
micro:bit GO modules that have the capacity to provide a multitude
of programmable digital solutions. When working in combination
with multi-functional and versatile Unmanned Aerial Vehicles (UAVs),
Autonomous Underwater Vehicles (AUVs), First Person View (FPV) and
Remotely Piloted Vehicle (RPV) technologies, the drone pilot trainees
have access to the CSER Project Officer, training opportunities and
Lending Library kit in order to SOAR with passion projects to suit their
needs.
All program participants are encouraged to work through their
pilot training and level up in order to SOAR to new S- safety, O-
Above:
operations, A- action learning and R- research heights.
Flight Officers use the Tickle app to pro-
gram a micro:bit and successfully.
micromag.cc 9
:NEWS Bitty Blue
Thermal
Pollution
Monitoring
with Bitty Blue
BY Martin Woolley How technology could help address environmental issues in
Saudi Arabia
T
wireless communications hermal pollution is an
and was lucky enough
environmental issue that we don’t Above:
to be involved in
creating the micro:bit hear a lot about. It involves the Bitty Blue from Bitty Software
as the team’s Bluetooth
specialist. artificially induced, rapid changing of the
ambient temperature of the sea, lakes or
rivers and it’s a serious problem which can I didn’t know anything about thermal
Twitter: have a devastating effect on fish and other pollution until a few months ago. In
@bittysoftware organisms as they succumb to thermal fact, I’d never heard of it and I’d like to
shock. share with you how it is that I came to
learn about the subject, all thanks to two
Find out more...
The most common source of thermal schoolgirls, Nouf and Mawwadah who live
You can learn more pollution is industry. Power plants and in Saudi Arabia.
about Bitty software and
Bitty Blue on Martin’s factories which dump heated wastewater
website: directly into the sea can cause a rapid Nouf and Mawwadah contacted me by
increase in water temperature and the Twitter, asking for some guidance on how
bittysoftware.
death of aquatic life. to approach a school project involving
com micro:bit. Their teacher had asked them
10 micromag,cc
Bitty Blue
:NEWS
to think about thermal pollution and how technology did exactly what it needed to. It looped, measuring
might help prevent it, and to build a working proof of the temperature every second or so and then sent a
concept. Bluetooth message containing a number which meant
“OK” (0), “Too Cold” (1) or “Too Hot” (2).
The project idea goes like this; imagine the wastewater
pipes from every factory by the sea were fitted with But what was their micro:bit sending these messages
special devices which could monitor their temperature. to?
If the temperature got too hot or too cold, risking
thermal shock, the device could inform a computer Bitty Blue is free of charge mobile application
system wirelessly, raising the alarm that the factory was from Bitty Software. It has a variety of features,
breaking the law and causing thermal pollution. all centred around micro:bit and its Bluetooth
capabilities. One of them, it so happens is a
Nouf and Mawwadah discussed ideas for the project temperature monitoring application, precisely
with me and I explained how Bluetooth, one of what Nouf and Mawwadah needed. Depending
the most commonly used wireless communication on the content of the Bluetooth messages it
technologies and which these days has a range of over receives from a micro:bit, it displays a big, clear,
a kilometre, could be an important ingredient in the graphical indication of whether the temperature
solution. We talked about the basic logic required to being monitored is too hot, too cold or within
periodically measure the temperature, check it and acceptable limits.
report any breaching of allowed temperature limits.
Below:
We talked about the programming concept of an
Bitty Blue temperature
“event”, how micro:bit “events” can be used to trigger monitoring
Bluetooth communication with an application on
another device and what the transmitted messages
would need to contain.
With a little guidance, Nouf and Mawaddah went on
to use MakeCode to create a micro:bit project which
micromag,cc 11
:NEWS micro:bit Live
micro:bit LIVE
ABOVE:
micro:bit stand at
BETT 2019.
M
icro:bit LIVE is a sions, poster sessions as
micro:bit LIVE will be taking place at the
two-day confer- well as network until your
ence all about the heart is content with fel- BBC MediaCityUK, Greater Manchester,
micro:bit, where you will low micro:bit enthusiasts
be able to discover some and micro:bit partners and England on October 4-5.
of the new teaching and don’t forget to come and
learning resources first find the micro:mag team.
hand. The event is being held at Tickets: go.micromag.cc/mblive
Learn about what is new MediaCIty in Manchester
within software and hard- with tickets being £22
ware as well as learn how each for the 2 days and
the micro:bit is being used lunch is included. The
around the world and foundation are giving
broadening the participa- all the ticket money to
tion in computing for all local Salford schools so
children. they can have access to
micro:bits. Tickets are
What is going being released in waves
and they’re selling fast so
on over the two don’t miss your oppor-
days? tunity to attend the first
Over the two days, you (and hopefully annual)
can participate in work- micro:bit conference.
shops, talks, panel discus-
12 micromag,cc
SCHOOLS
:FEATURE
Bitty Software
:FEATURE SCHOOLS
MICRO:BIT IN
SCHOOLS
What I did when I taught Year 2 at my mum’s school some micro:bit coding
using the 4tronix Bit:Commander. By Sam Watson.
A
s I had a teacher training day at my
About the Author
school but my mum didn’t I decided
to go with my mum to work and teach
some Year 2s coding with the micro:bit
alongside the 4tronix Bit:Commander.
14 micromag.cc
SCHOOLS
:FEATURE
Bitty Software
My Mum chose 8 children at a time to come and I worked with different groups of children all
work with me using the code on the last page, the morning before I went and had my lunch. After lunch,
children could edit the ‘Show LEDs’ and ‘Show String’ I did the same again but with the other Year 2 class.
blocks to how they wished. Each child chose their own Again I taught small groups and all the children really
pattern or message. enjoyed experimenting with the micro:bits.
RIGHT:
The 4Tronix bit:bit
Robot.
micromag.cc 15
:FEATURE GAMES
MICROPYTHON MICRO:BIT
GAMES
Phil Hall has ported two classic games to the micro:bit using MicroPython
and has a view to improve them. Check them out!
F
About the Author
irstly you’ll need to download the games
from GitHub (https://github.com/rhubarb-
You will need
»» A BBC micro:bit
dog/microbit-games). Click the “Clone or /
»» A computer with internet connection
Download” button, click “Download ZIP”
»» Software you may find useful:
from the dropdown. Follow your operating system’s
microfs, to see the micro:bit filesystem
usual instructions to extract the files. These games
Mu Editor, a simple python editor
are written in MicroPython, there is also .hex files
which can easily be copied to a micro:bit.
Phil has a Degree
in Computer There’s nokia classic snake.py and a maze.py
snake.py
Science and have game implementing a viewport. Concepts like This is a port of the Nokia 3310 classic snake.
been tinkering with
high score tables and game timers will be dis- Using the micro:bit’s accelerometer you tilt the
computers and
electronics for the last cussed. These games are basic skeletons there’s micro:bit to steer the snake around the screen.
35 years. I now live in a whole load of opportunities to re-use this code Eat food to score points and grow. Avoid eating
Yorkshire, England. to create your own games. The idea of providing your tail, or you’ll die and that’s game over.
Phil is known as @ people with these games i’ve created is so that The snake stores its tail’s location in a
rhubarbdog on many they can learn from the code but also help me by python list. Adding the current position before
sites including Slack, moving and deleting the oldest coordinates if no
IRC, Stack Exchange,
improving them. If you do something cool with
Linux, Raspberry Pi the games, please do share them with me using food was eaten.
and MicroPython one of the platforms listed in my author bio.
forums Let’s take a look at each of the games.
16 micromag.cc
GAMES
:FEATURE
Bitty Software
moving and deleting the oldest coordinates if no food was There are two things any game will benefit from thats a
eaten. high score table and a clock to let you know how long you’ve
actually been playing.
The game is quite hard due to the lack of space a 5x5
screen gives. Expanding the micro:bit with a 8x8 or bigger
LED matrix makes it much more playable.
Above:
A simulation of what maze.py
looks like
hi-score.py
Code snippets to include high scores are covered in
this file. It uses the file system on the micro:bit, so high
Above: scores are maintained when the micro:bit is reset or has no
A simulation of what snake.py power. It’s only possible to have high scores in MicroPython
looks like
programs Microsoft MakeCode doesn’t support accessing the
micro:bit’s file system.
maze.py
The first thing this game does is introduce a playing area
much larger than the micro:bit screen. The screen is used as clock.py
a viewport into this much larger world. Like snake you tilt the This file defines a single class Clock. This is a by the second
micro:bit to move the player through the maze trying to find timer with no wrap around under MicroPython. If you
the exit. The player is the blinking pixel, the exit the pulsating wish to make a Microsoft Makecode implementation it will
one. handle times upto 12 days. Don’t use this clock to record
intervals accurately it is upto a second slow.
The limit with this game is the memory constraints
of running a MicroPython program on a micro:bit. More The class Clock has 5 methods
features are possible in your games if you use Microsoft start – start the timer
MakeCode. Extensions i’ve experimented with is escaping stop – stop the timer
the maze in the smallest number of steps or quickest time. reset – reset it to 0 and keep going if the clock wasn’t
Placing a collectable token in every space, you win by already stopped
collecting them all. To add enemies like the ghosts in Pac- time – The number of elapsed seconds since it was last
Man wasn’t possible in MicroPython and I’m yet to complete reset
the task in Microsoft MakeCode. It’s quite easy to create sleep(milli seconds) – This method should be used in place
a different maze or place the player and exit in random of the microbit.sleep function or either the time.sleep or
locations. If selecting random locations ensure they aren’t in time.sleep_ms function As it handles the updating of the
a wall or the exit is in the same location as the player. number of seconds.
micromag,cc
micromag.cc 17
CALL FOR CONTRIBUTIONS
WRITE AN
ARTICLE FOR
THE NEXT
MICRO:MAG
We want to hear about your awesome
micro:bit powered project, event or story
GET FRESH
COPIES DIRECT
TO YOUR
INBOX!
Never miss an Issue and be the first to find out
when a new Issue get’s released by subscribing.
MicroPyt
on the m
hon
the micro:bit. Cover Feature Collated by Joshua Lowe
S
tarted by Guido Van
Rossum 29 years ago in
1990 as a small project,
Python is now the worlds
fastest growing programming
language and it’s not hard to see
icro:bit
why. Within the Python Com-
munity, there is a saying “Python
is the second-best language for
anything” which means that
no matter what, you can pretty
much guarantee whatever pro-
ject you’re trying to make, you
can use Python to power it.
In recent years, there has been
a large uptake in Python on
Hardware. This is down to a port
of Python called MicroPython
which is a stripped-down version
of Python made specifically to
run on small microcontrollers
like the micro:bit and the ESP32.
Back when the original micro:bit
project was in the works by the
BBC, a team of people from the
PSF which included Nicholas Tol-
lervey and Damien George (The
original creator of MicroPython)
created the port of MicroPython
for the BBC micro:bit.
This amazing project continues
to live on and we’d really like to
see more people using Micro-
Python on the micro:bit. So, we
have compiled this Cover Feature
which showcases some cool Mi-
croPython guides, some projects
and also a special micro:hit 9
step MicroPython challenge!
micromag,cc
micromag.cc 21
Cover Feature PYTHON
Getting Started
Below are two popular MicroPython editors. Find out more about them and
choose the one you like best.
T
he official MicroPython editor from the micro:bit
Educational Foundation is probably the quickest way
to get up and running with MicroPython on your
micro:bit as it’s web-based and accessible from most web
browsers.
The online editor is perfect to use within schools or
anywhere where you don’t have control over your network the capability to add libraries and other files to the micro:bit
as you don’t need to install any additional software. easily via a new menu in the editor. You can find the link to
The online editor has a snippets button at the top which the stable version of the editor below but you can also get
allows you to reuse commonly used blocks of code very the BETA at python.microbit.org/v/beta.
easily without typing them out repeatedly.
python.microbit.org
Some really cool features are coming soon to the online
editor like a Repl, direct flashing and also
M
u is a Python code editor for beginner
programmers which was originally built
for the BBC’s micro:bit rollout. Since then,
Mu has grown into a fully-fledged Python editor which
supports multiple Python modes like CircuitPython, Python
3 & PyGame zero, just to name a few. It does, however, still
retain support for the micro:bit.
Mu is a downloadable editor that works on Windows, to your micro:bit and also see a serial output. There’s also
macOS, Linux & Raspberry Pi and is visually similar to a checker that will check for any errors before you run your
the web python editor but with lots more features, let’s program and last but not least, you can also easily flash your
take a look at some of them. In Mu, it’s easy to access the micro:bit with one button instead of drag and drop. Below is
filesystem so you can use python libraries. This is handy the website where you can download Mu.
if you want to use add-ons. You have access to the REPL
which, with a click of a button, you can send commands
codewith.mu
22 micromag.cc
PYTHON
Cover Feature
Useful Links
There are plenty of places that are super useful when getting started with
MicroPython on the micro:bit that you should take a look at!
go.micromag.cc/mpymws
Python coding on the
micro:bit Book
For those of you who prefer a physical book, there’s a
great one that’s been written by James Gatenby and
it explains the features of MicroPython with simple
language. There’s also several examples and projects to
help you get started. You can buy it on Amazon and
at CPC.
go.micromag.cc/mpybook
go.micromag.cc/mpyeb
micromag.cc 23
Cover Feature PYTHON
10 Mini Projects
We’ve created 10 mini projects in MicroPython to help you explore the possibilites
of MicroPython on the BBC micro:bit.
Projects 1 & 2
Project 1 from microbit import *
import random
10 Mini Projects
Projects 3 & 4
go.micromag.cc/mpyp3 display.show(Image.NO)
Project 4
Simple Dice
from microbit import *
This project will create a simple dice import random
This is a great little project if you want to while True:
play a board game, but the dice seems to dice = random.randint(1,6)
have been misplaced. Let’s get coding! if accelerometer. is_gesture(‘shake’):
display.show(dice)
Github Code Link:
go.micromag.cc/mpyp4
micromag.cc 25
Cover Feature PYTHON
10 Mini Projects
Projects 5 & 6
Project 5
Coin Flip from microbit import *
import random
This project will create a Coin Flip Game. while True:
When you press the A button, the micro:bit if button_a.is_pressed():
will choose from True or False and display if random.choice([True, False]):
a happy or sad image depending on the
display.show(Image.HAPPY)
choice.
else:
display.show(Image.SAD)
Github Code Link:
go.micromag.cc/mpyp5
Project 6
Hello World
from microbit import *
When learning a new programming
display.show(Image.HAPPY)
language this will typically be the first
while True:
program you learn to create, but this literally
if button_a.is_pressed():
takes about a minute with a micro:bit. So I
have decided to integrate the buttons and display.scroll(“Hello World”)
display some images too. elif button_b.is_pressed():
display.show(Image.HEART)
Github Code Link:
go.micromag.cc/mpyp6
26 micromag.cc
PYTHON
Cover Feature
10 Mini Projects
Projects 7 & 8
Project 7
Step Counter from microbit import *
steps = 0
This project will create a step counter.
while True:
Everytime the micro:bit is shaken it
increases the number of steps by 1. Lets display.scroll(steps)
get coding! sleep(50)
if accelerometer. is_gesture(‘shake’):
go.micromag.cc/mpyp7
Project 8
Temperature Sensor
This project will create a
from microbit import *
thermometer
Grab the temperature of the while True:
micro:bit to get an approximate if accelerometer.is_gesture(‘shake’):
temperature reading when you temp = temperature()
shake the micro:bit.
display.scroll(temp)
micromag.cc 27
Cover Feature FEATURE
10 Mini Projects
Projects 9 & 10
go.micromag.cc/mpyp9
Project 10
Touch a pin from microbit import *
When you touch a pin on the while True:
micro:bit, this project will scroll a if pin0.is_touched():
message on the micro:bit display display.scroll(“You touched Pin 0!”)
saying which pin you touched.
elif pin1.is_touched():
display.scroll(“You touched Pin 1!”)
Github Code Link: elif pin2.is_touched():
go.micromag.cc/mpyp10 display.scroll(“You touched Pin 2!”)
28 micromag.cc
P R I N T E D I T I O N S N O W AVA I L A B L E
GRAB YOUR
PRINT EDITION
OF MICRO:MAG
TODAY!
Each Issue will now be available in print for a
month after it’s release date for £5.99 each!
Les is a maker
and trainer who
Step 1 - Strip the wires
has worked with
the Raspberry Pi
Foundation and
the BBC to deliver
computing training
»» BBC micro:bit
To use our LEDs we need to snip the wires from Step 4 - Using Mu
the battery pack, and then strip the wires. To snip
»» USB Cable
and strip we can use any wire cutters.
»» Mu (codewith.mu)
»» 2x Crocodile Clips
Step 2 - Connect & Test
»» LED lights
powered by 2 x AA
batteries (Pound /
Euro / Dollar stores
sell these)
30 micromag.cc
To the left:
The micro:bit all wired
up to the LEDs.
a loop that will run as long as the micro:bit is powered on. the micro:bit and watch the LEDs flash!
loop and a range. Setting the range to 3, the loop starts at 0 from microbit import *
and every time it goes round it counts up to 3.
micromag.cc 31
:MAKE ScaraBot EDU
ScaraBot Edu
Above:
ScaraBot EDU
Base and Remote
Controller
S
About the Author caraBot EDU is a DIY drawing robot based both based on the micro:bit:
on the micro:bit, which will allow you to ScaraBot EDU Base
explore: generative art with coding, math ScaraBot EDU Remote Controller
and geometry, and the art of doodle design
by hand-control. Designing and building ScaraBot You can make drawings in two ways:
EDU has been a great learning experience to me,
encompassing: electronics, 3D modelling, 3D
As a STEM Educator Adriano printing and making. Once my ScaraBot EDU was Remote Controlled Mode
designs and runs one- ready, it was amazing to start making and drawings
shot workshops to annual ScaraBot EDU can be remote-controlled by a second
through coding or via remote control. I hope it will
technology laboratories,
based on Creative Learning. be the same for you! micro:bit through radio frequency communication.
Adriano also likes making The ScaraBot Radio Controller is like a joypad and
things with hands and mind
and likes tinkering with
depending on how you move it, it sends specific
different materials. radio commands to the ScaraBot EDU Base.
Twitter: @CyberParra
FEATURES For example: if you tilt the ScaraBot EDU Radio
The ScaraBot EDU is formed from two main parts, Controller down, it sends the “forward” message to
32 micromag.cc
ScaraBot EDU
:MAKE
micromag.cc 33
:MAKE Timing Gate
Toy Cars
Timing Gate
I
n this project, Two micro bits are used as timing traps. A torch shines a light
BY Robert Wiltshire
across the track onto a micro:bit. The micro:bit LEDs are sensitive to light and
when a car’s shadow passes in front of the LED the drop in light intensity sig-
About the Author
nal can be used to trigger a timer. One micro:bit to start, a second to stop. A third
micro:bit then receives the timing signals, reads the times then calculates and displays
the speed for each run.
Twitter:
@SwCornwall
34 micromag.cc
Timing Gate
:MAKE
Right:
mcro:bit with
masked LED]
The Timer
The micro:bits can count, in millisec-
onds, the amount of time that has
passed since they are switched on.
By recording the time at the point of
receiving the two messages and sub-
tracting the lower start time from the
larger stop time the elapsed time is
found. If you then know the distance
between the two LED on the track
the speed can be calculated.
radio.on() Here is the display showing two times and the speed.
print(“Ready”)
start_time = 0
stop_time = 0
LED_distance = 0.25
while True:
message = radio.receive()
if message == ‘Start’:
start_time = ticks_ms()
print(“Start timing at “ + str(start_time))
elif message == ‘Stop’:
stop_time = ticks_ms()
print(“Stop timing at “ + str(stop_time))
time_difference = stop_time - start_time
car_speed = (LED_distance / time_difference) *
1000
print(“Speed of car “ + str(car_speed) + “ m/sec”) So which of your cars is the fastest, or
slowest!
Flash this code and then, assuming you’re using Mu,
click REPL. The Python chevron >>> will appear. Restart Full instructions and 3D STL files are available at :
the micro:bit by pressing the button on the rear. The https://go.micromag.cc/timing_gate
“Ready” message will show the code is running and
waiting. Now let a car drive down in front of the gates.
micromag.cc 35
:MAKE Texting MP
TEXTING WITH
MICROPYTHON
Can micro:bit send text messages with only two buttons using
MicroPython? By Christopher Roscoe
36 micromag.cc
Texting MP
:MAKE
The Main Loop OfChars this makes sure you can’t go if incomingMessage:
beyond the available characters # plays ringtone on receipt
Although I dare say a lot of this
charNum = charNum % number- music.play(music.RINGTONE)
could be rewritten as functions, I
OfChars # scroll that message
haven’t got my head around them yet
# just plays middle C display.scroll(“” + incomingMes-
so I stuck to tried and tested methods
music.play(“C3:1”) sage)
that I could make work but you could
sleep(100) # we added this while # wait one second
rewrite this as a challenge. I annotated
testing as it occasionally crashed sleep(1000)
it as I was writing it so that I knew what
# select one character from # display the message again
each section did. A year on I can still
charList display.scroll(incomingMessage)
understand what I was trying to do but I
character = charList[charNum] # reset the incoming message.
am not always this fastidious.
# show the current character incomingMessage = “”
# This is the main loop that makes
display.show(character)
the programme work
while True:
# this should then prevent the elif How it works
for a single button press of A or B Click on button A to display the next
# resets the variable for each pass
doneButtons = 1 available character in the charList vari-
through the loop - it will only be 1 if a
# This is where we confirm the able.
button has been pressed.
selected character and Click on button B to select that character
doneButtons = 0
# add it to the end of the message Click on both buttons together to send
# Pressing both buttons will send
and play a note the message.
the message and play a tune
micromag.cc 37
:MAKE Activated Art
A
rt is a form of communication, a way of How might Kandinsky’s artwork differ if he
About the Authors
sharing feelings and ideas with oth- were able to include motion as well as colour
ers. Think about the idea or feeling you and shape?
would like to share with people who will expe-
rience your masterpiece.
Plan
In this short activity, you’ll combine the »» What would you like your masterpiece to look
movement of a servo motor with shapes and
Su Adams is like?
colour to create your own artistic masterpiece
a Computing
inspired by abstract artist Wassily Kandinsky. »» How will you communicate the feeling or idea
Curriculum Specialist
and business owner Kandinsky explored whether shape and colour that you are trying to share?
of U Can Too alone could be used to represent feelings and
»» What shapes will you use and which colours?
music. For example, Kandinsky felt that the col-
our yellow expressed a sound like a trumpet and »» Which element will you make move and how
that if certain colours were used together they will you use motion to enhance and improve
could create harmonies like a chord.
your masterpiece?
You will need... Then, choose a background colour paper
Katie Henry is the and lay it over top of your box. Poke a hole in the
Director of Learning »» Cardboard Box (Any Size will do)
paper where the motor will push through. Next,
for BirdBrain »» Coloured Paper (Large sheets + Shapes) pick the coloured shapes that you would like
Technologies.
»» Hot Glue, Blue Tac or any Adhesive to use and stick them onto the coloured back-
Creators of the
HummingBird Kit »» HummingBird Kit with micro:bit. ground in the position you would like. Attach
38 micromag.cc
Activated Art
:MAKE
Left:
A student creates a
Kandinsky-inspired
work of art using
the Hummingbird
Robotics Kit and craft
supplies
sensor (in the eye of the fish), one ultrasonic distance sensor
your artwork to the box, making sure that the hole in
(top, middle of the robot), and one potentiometer (top right
the paper lines up over the motor. Finally, affix your corner of the box).
moving element to the top of the servo horn.
Below:
This is the back of Pablo’s robot.
Above: With flexible robotics kits like the
This robot was created by Hummingbird Robotics Kit, you can
easily make amazing projects
Pablo, (@pablisch on twit-
ter) using the Humming-
bird Robotics Kit
Extend
Inspired by Paul Klee’s The Goldfish, STEAM lead at
Devonshire Hill Primary School Pablo Joyce affixed more
than just paper to his box. He used assorted craft supplies
and reusable material such as discarded styrofoam and balsa
wood. Each section of this fish moves because of the cam
and follower mechanism Pablo built on the back. This project
uses 5 LEDs, one motor (mounted in the back), one light
micromag.cc 39
Reviews wifi:bit
wifi:bit
Add WiFi cabability to your micro:bit with this neat ESP8266
based board from e-radionica . By Joshua Lowe
T
HE micro:bit is packed board is super simple to use with a support for MicroPython, this seems
full of features like an provided MakeCode package and a to be a common trend for many new
AVAILABLE FROM accelorometer, bluetooth few examples on the website. add-on boards. It’d be great to see
e-radionica and radio communication to name The library has lots of functionality MicroPython support for this board
go.micromag.cc/wifi a few, however, one feature that it to get you started. Only 2 blocks are in the future.
lacks it the ability to connect to the required to connect to the wifi:bit Another cool feature of this board
internet to unlock the Internet of and your wifi at home. Digging a bit is the easy-c connector which allows
Things. deeper into the library, you can use you to connect different modules
What’s Included?
Croatian based company the HTTP request block to interact via a grove type connector to allow
- wifi:bit E-Radionica saw a gap in the market with the external API’s, for example easy expansion where you can add
for a WiFi add-on for the micro:bit you could control Philips Hue lights sensors and other cool components.
to add this functionality. wifi:bit is or interact with a a service on IFTTT, We’d pick one up if you’re looking
Price
based on the ESP8266, a popular the possibilites are endless! for a different type of add-on board.
$15.07 USD microcontroller that has a wifi chip Another cool feature in the
€14.66 EUR onboard. The board is super easy MakeCode library is the Blynk block
£12.41 GBP to connect to the micro:bit with its which allows you to easily interact
Approx edge connector and one thing I liked with the Blynk service which allows
OUR RATING
about the board is the fact that the you to control pins on the Raspberry
9/10
pins are broken out at the bottom Pi and extend the functionality with
of the board so you don’t loose Internet of Things.
access to unused pins, something One thing that I see as missing
that many add-on boards lack. The from this development board is
Below:
With the wifi:bit,
its super easy to
access the IoT.
40 micromag.cc
Inksmith K8
Reviews
Inksmith K8
The modular kit for learning coding and robotics with the
micro:bit. By Joshua Lowe
W
AVAILABLE FROM e see a lot of micro:bit robot motors you can find in most on the Teachable website are
Inksmith Store robots with testing prod- robot kits. These motors have a enough to have a whole curriculum
go.micromag.cc/ ucts and doing reviews good speed and work well. I found built around the robot which is super
buyk8 for the magazine. Some have amaz- that construction was slightly fiddly handy for schools. Unfortunately,
What’s Included? ing features but lack support, some compared to other robots that I have I can’t help but notice the lack of
of them are more advanced than assembled in the past but once I got MicroPython support for this robot,
- Front Ultrasonic others. However, the Inksmith K8 the hang of it, the K8 was quite fun I feel that this is one of its main let
Sensor.
robot is different, its feature packed to build. Going back to that lovely downs. I’d really like to see this in the
- 3 line following
sensors and even has its own curriculum! purple PCB, it has an easy to use future. All in all though, the K8 robot
Let’s take a look. edge connector for the micro:bit is really one of the best micro:bit
- 2 wheels
Unlike many micro:bit robots, the as well as connectors on the back robots out there, with its premium
- Battery Pack
K8 is made from a purple injection for 3 line following sensors, a sonar packaging, design and resource
- K8 Robot Driver
board moulded plastic chassis, most of the sensor, two motors, 2 servos (so selection it really is the perfect robot
- 2 9 Gram Servo other robots we’ve used or reviewed you can build robot arms etc.) and a for schools and code clubs alike and
Motors have just used the PCB as a chassis barrel jack connector for the battery you should consider picking one up!
so having a nice case really makes back power. Once assembled, the
Price this robot feel premium. The heart K8 robot is a feature packed robot
OUR RATING
$60.43 USD of this robot is the K8 driver PCB and for the price of $60 USD. One of the
8/10
it’s certainly a good looking purple great things about the K8 robot is its
€53.99 EUR
PCB. We really liked the design and selection of tutorials and resources.
£49.77 GBP
layout of this PCB, it’s a nice touch. Inksmith have really excelled with
Approx The robot uses two classic yellow the selection they offer. The courses
Below:
A fully built K8
robot with all its
sensors attached.
micromag,cc 41
YOUR PRODUCT/AD HERE
ADVERTISE
IN THE NEXT
ISSUE OF
MICRO:MAG
Grab the attention of thousands of micro:bit
community members by Advertising.
HELP US
COVER THE
COSTS OF
MICRO:MAG
We are run by a team of passionate community
volunteers, but we still need help covering costs.
DONATE TO MICRO:MAG
VIA PAYPAL:
micromag.cc/donate
Previous donations have helped us get a designer to design
the new layout, cover domain costs and much more!
micromag.cc
£5.99