MicroBit-Quick-Start-Teacher-Guide
MicroBit-Quick-Start-Teacher-Guide
MicroBit-Quick-Start-Teacher-Guide
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>Quick</strong> <strong>Start</strong> <strong>Guide</strong> for <strong>Teacher</strong>s03To create the first function (for our AWAKE face),select the script button from the top of the screen.Click on the + button to bring up your resourcesmenu.PREVIEW04Select function from the menu. This will bringyou to a coding area (as shown right). Notice thatit will say do stuff at the top. This is the currentname of the function. Click on do stuff andrename your function set awake. Click OK.05Now that we have named our function, we needto specify which LEDs should be turned on withinthe function. We can do this using the imageeditor. Click do nothing in the coding area. Akeyboard will pop up at the bottom of the screen.Select micro:bit. Notice how the keyboardchanges. Select create image.06Select the button on the code keyboard thatlooks like a grid. This will bring up your imageeditor. Each box represents one of the LEDS onthe BBC micro:bit display. Select the appropriateboxes (to match your grid from step 1) to createyour AWAKE face. Click off the editor to return toyour code. Click store in var (to store this datain a variable). Press the + button to add a newline of code. In the code keyboard click img(this is the variable you have just created).Click show image.07You have now completed your first function.It should look something like this.Use what you've learnt so far to create the othertwo functions for the ASLEEP and EATINGstates of your digital pet.Name your A function set sleep and yourEATING function set eat.16