Image

INTRODUCTION

Since the release of the BBC micro:bit in 2016, millions of these devices have been distributed. They’re enjoyed by both kids and adults all over the world. The micro:bit was designed as an easy way to teach kids programming skills. One of its great advantages is that you don’t need anything more than a USB cable and a computer to start using it. Also, once programmed, it can be disconnected from a power source and run on batteries.

The micro:bit has a small LED display as well as sensors for light, movement, and magnetic fields, so it has everything you need to make interesting projects. When you’re ready, you can easily connect things like motors, sensors, and loudspeakers using alligator clips—there’s no need for soldering. In other words, your micro:bit can be the brain for lots of projects and inventions.

Image

ABOUT THIS BOOK

In these pages, you’ll find a variety of experiments and projects. The experiments show you how things work, and then in the projects, you’ll use that knowledge to make something funky.

The book is divided into 10 chapters. Chapter 1 tells you all you need to know about connecting and using your micro:bit. You’ll use this information in all the experiments and projects in this book. Each of the following chapters deals with a specific topic, such as light, sound, and movement. There are lots of fun and useful things you can do with your micro:bit!

Experiments

Here’s a list of the experiments in the book:

Generating sounds Learn to make your micro:bit play musical notes and other sounds.

It speaks! Teach your micro:bit to speak!

Sensing light Use the built-in light detector.

Measuring magnetic fields Use the built-in magnometer to sense magnets.

Gestures Use the micro:bit’s gesture recognition software to have the device do different things when you shake, drop, or throw it.

Real-time acceleration plotting Learn about Mu’s data visualization feature.

Logging acceleration to a file Record the data detected by the micro:bit so you can look at it later.

Making a servomotor move Experiment with motors!

Keeping time Learn how the micro:bit tells time.

How fast are your nerves? Test your reaction time.

Measuring temperature Use the micro:bit temperature sensor to build a thermometer.

Finding the radio range Learn how to use the micro:bit for radio communication.

Projects

Here’s a list of the projects in this book:

Musical doorbell Plays a tune of your choice when pressed

Shout-o-meter Detects a sound and shows how loud it is

Automatic night-light Turns on by itself when the room gets dark

Light guitar Makes music when you wave your hands over the micro:bit’s LEDs

Infinity mirror Creates the illusion of infinite depth using light

Compass A real working compass!

Magnetic door alarm Goes off when you open a door, separating a magnet from the micro:bit

Toothbrushing monitor Measures your brushstrokes to make sure you’re keeping your pearly whites in good order

Acceleration display A meter that shows how quickly the micro:bit is accelerating

Animatronic head A robotic head that has moving eyes and a talking mouth

Robot rover A two-wheeled micro:bit robot!

Binary clock Tells time using LEDs

Talking clock Announces the time every hour and whenever you press a button

Lie detector Measures electrical currents in the skin to tell whether someone is lying

Temperature and light logger Automatically keeps a record of light and temperature levels

Automatic plant waterer Waters your plants whenever it senses that the soil is too dry (Never again kill a plant!)

Wireless doorbell A wireless upgrade to the doorbell project that uses radio waves

Micro:bit-controlled rover A wireless version of the roving robot that receives your instructions via radio

CODE AND RESOURCES

The two most popular computer languages for programming the micro:bit are Makecode Blocks (referred to as just Blocks in this book) and the MicroPython programming language.

Wherever possible, I’ve provided programs for the projects and experiments in both Blocks and MicroPython. This means you don’t have to type in the code yourself—unless you want to.

You can find all the code for the activities in this book at the companion GitHub page: https://github.com/simonmonk/mbms/. I provide full instructions for accessing and using the code in Chapter 1.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.140.242.165