O'Reilly logo

The Official BBC Micro:bit User Guide by Gareth Halfacree

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5

JavaScript Blocks

In this chapter

check An introduction to programming in the JavaScript Blocks Editor

check ‘Hello, World!’: your first JavaScript Blocks program

check Programs for reading from button inputs, touch inputs, and the temperature, accelerometer, and compass sensors

check Fruit Catcher: a simple game to program and play on your BBC micro:bit

JAVASCRIPT BLOCKS IS a great entry into programming for younger readers and those without previous computing experience. Its visual environment makes it easy to see which parts of a program go together, and by dragging prewritten code blocks from the toolbox, mistakes are far harder to make than in traditional nonvisual programming environments.

In this chapter you’ll be introduced to the JavaScript Blocks Editor, powered by Microsoft MakeCode, and learn to write a series of programs that make the most of the BBC micro:bit’s capabilities. Finally, you’ll be able to make a quick-fire game in which you’re given the task of catching ever-faster falling fruits before they hit the ground.

Introducing the JavaScript Blocks Editor

The JavaScript Blocks ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required