Science Oxford Logo

CCC - Creature Circuits - Python Version!

Resources for the 'Creature Circuits' Creative Computing Club.

During this workshop, you will create and code a 'creature' using a BBC micro:bit, some conductive and insulating dough, and some electronic components.

To make your own dough at home, follow the instructions at Squishy Circuits.

This page recaps what we discussed as a group.

To skip to the examples and ideas, click here.


Getting started

If you would like to do this activity using MakeCode instead, click here!


Go to the Python editor, then follow the instructions to pair your micro:bit.

You should see some starter code on your screen, like the below screenshot.

screenshot of the python editor, showing starter code

Adapt the starter code and test it on your micro:bit - what images can you find?

You can design your own images as well as using the built-in ones! Click here for instructions.


Using the A and B buttons

Inside your while True loop, type:

  if button_a.was_pressed():

Anything that is indented underneath this, will happen only if the button is pressed.

Try this update to the starter code above:

while True:
  if button_a.was_pressed():
    display.scroll('Hello, World')
    display.show(Image.HEART)
    sleep(2000)

Challenge - can you make one thing happen when you press button A, and something else when you press button B?


Adding an LED

LED wiring photo

Take a crocodile clip, and connect one end of it to pin 0 on your micro:bit.

Connect the other end of your crocodile clip to the positive lead of your LED (the longer one).

Connect a second crocodile clip between the GND pin on your micro:bit, and the negative lead of your LED (the shorter one).

Now add the below code into your while True loop (remember your indentation!)... what happens to your LED?

  pin0.write_digital(1)
  sleep(500)
  pin0.write_digital(0)
  sleep(500)

What would you need to change in the code if you connected the LED to pin 1 or 2 instead of pin 0?


Making a circuit using dough

Click here for the instructions!


What next?

When you have created your dough creature, you can add some extra features. The links below will help you with a couple of our ideas!