16.07.2015 Views

MicroBit-Quick-Start-Teacher-Guide

MicroBit-Quick-Start-Teacher-Guide

MicroBit-Quick-Start-Teacher-Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Challenge 3: Catch the egg gamePlot the starting positions of the LEDsPREVIEWAll LEDs on the BBC micro:bit display are OFF by default. We’re going to set theBBC micro:bit to plot our first lights.12Click the + button to add another line of codebelow your assigned variables. Select themicro:bit library from the keyboard and thenselect the plot button (on screen 2 of thekeyboard). You should now have somethingwhich looks like the image shown on the right.13The code shown above will only turn on a LED atposition 0,0. We need to remove each of thesevalues and replace them with our obstacle xand obstacle y value. Delete the first 0 and thenselect obstacle x. Repeat this process to enterobstacle y.14We now need to plot the starting position of thebasket (x). Click the + button to add a new line ofcode. Then select the micro:bit library from thekeyboard and then plot. Change the first 0 to thex variable and the second 0 to 4.Test your codeIt’s important to test that our code is working correctly so we can debug any errors.Regularly remind students of the importance of testing.15At this point in the program we’re going to runit by selecting the run button. You should seesomething similar when you run your program.23

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!