What is boolean logic? KS3 discovery lesson resources using BBC micro:bit

What is boolean logic?
What is boolean logic?

Boolean logic is a way of making decisions based on the answers to one or more TRUE / FALSE questions.

It’s often used in electronic circuits or computer science programming because TRUE and FALSE data can be easily represented by binary 1s or 0s, or by electricity being switched on or off.

Pupils in key stage 3 (aged 11-14) in the UK have to be taught how to:

Understand simple Boolean logic [for example, AND, OR and NOT] and some of its uses in circuits and programming

This is probably the most misunderstood part of the curriculum that – if pressured for time – is perhaps most likely to be missed out from computing schemes of work.

Mr Conroy, from Tadcaster Grammar School, had a brilliant idea for teaching this and he’s kindly agreed to let it be shared here.

Rather than start by explaining what boolean logic, students are encouraged to discover for themselves by pressing buttons on a BBC micro:bit and writing down what they see on the screen.

Students have a worksheet to complete with 6 tables. Each of these tables has space to write down what buttons they’re pressing on a micro:bit and what they see on the screen for that combination of buttons.

This then leads to a discussion about truth tables, where you can look up what the output is going to be if you know what the inputs are.

The next page contains the code you can use to program the micro:bits along with the worksheets students can complete.

Continue ReadingWhat is boolean logic? KS3 discovery lesson resources using BBC micro:bit

Code your own ticklish talking Dalek: microbit python speech

It’s been less than a year since I first launched create.withcode.uk to let students and teachers write, run and debug python code without needing to download any software or create any user accounts. Since that time, a new job and new baby have made me fall behind some of the amazing new features added to the micropython runtime for the BBC microbit.

Thankfully, the Christmas holidays have arrived and I’ve now got a little bit of time whilst the boys are asleep – whilst I should be starting on the sack full of marking, reports and lesson prep – to catch up and post some new resources.

microbit ticklish talking dalek python project
microbit python speech: code your own ticklish talking dalek

I’ve posted before about being able to connect up a speaker to a micro:bit to play sounds. Well, Nicholas Tollervey and the team working on the microbit python runtime have been adding some old speech synthesis code from the 1980s into the micropython runtime that lets your microbit speak. It sounds suspiciously like a dalek from Dr Who, but it’s a really fun feature on such a small device.

I’ve been working on the microbit simulator to let you try out the new speech module in your code. I’ve tested it with firefox and chrome but Internet Explorer doesn’t support web audio so if you’re stuck with using that you can still write and run your code and download it to your microbit but it wont actually speak unless you download the sound file each time your code tries to speak.

Here’s an example program that turns your microbit into a talking dalek that you can tickle by pressing button A:

Curious computing
Try changing the values and see what happens

Have a play and see if you can:

  • add your own phrases that you’d like the micro:bit to say when you tickle it.
  • use the API documentation to get the micro:bit to sing a song
  • find out the maximum length of text that the micro:bit can say. What happens if you try and say more than this?


Continue ReadingCode your own ticklish talking Dalek: microbit python speech
Read more about the article RPi GPIO python simulator
RPi GPIO Python simulator

RPi GPIO python simulator

Following on from the micro:bit python simulator on create.withcode.uk, many students and staff have requested a python simulator for the Raspberry Pi GPIO pins.

This quickstart guide talks you through how to start writing code for physical computing using the GPIO pins on a Raspberry Pi.

It’s designed for teaching students how to do physical computing without having to invest in a separate Raspberry Pi for each student.

You can write, run, debug and share code that simulates the GPIO pins reading inputs and controlling outputs in a web browser then just have one (or more) Raspberry Pis set up with LEDs and switches connected up to demonstrate the same code.

This speeds up development time and reduces set up time and costs.

RPI GPIO Python simulator
RPI GPIO Python simulator

Physical computing is much more fun when students can actually see their code controlling a real life device – so this isn’t designed to replace actually plugging in and connecting up the physical components.

This simulator is designed to supplement and complement the actual physical computing: to iron out the more frustrating parts of the development process so students can focus on tinkering with the code, debugging, sharing, collaborating and exploring.

Try out the RPI GPIO python simulator here: https://create.withcode.uk/python/A3


I hope it’s useful!

Continue ReadingRPi GPIO python simulator