Year 3, Term 4: Coding
Scope and sequence: Coding
engage in coding to interact with virtual and tangible
Australian Curriculum (version 9.0)
"A student defines problems, describes and follows algorithms to develop solutions." (ST2-3DP-T)
"Students learn to implement simple algorithms as visual programs involving control structures and input." (AC9TDI4P04)
Introduction to the topic
This video (1:49) from NASA is an engaging look into the importance of coding.
Introduction to block-based coding
Introduction to block-based code using micro:bit (https://makecode.microbit.org/).
This video (2:09) is also a very good introduction to the
The following picture identifies some of the components and features of the Micro:bit.
Using buttons on the micro:bit
The following screenshot depicts an introductory activity using the two buttons on the micro:bit. The code file is here (right click, 'Save link as...') but it is recommended that you write this instead to model the coding process.
Making a simple game
This game uses randomly generated coordinates to light up an LED each time Button B is pressed. The aim is to illuminate all of the 25 LEDs as quickly as possible but the last ones are the hardest to get because the randomly generated coordinates will often be illuminating an LED which is already lit so it might appear that nothing is happening for a while.
Pressing Button A will clear the screen and restart the game. If other students have this game loaded on their micro:bits they can race each other by commencing the game at the same time.
To make a potentially faster version of this game, modify the code so that each button will turn on an LED. The game will then allow you to use two thumbs or fingers instead of one. Also, modify the code so that the game is reset by pressing Buttons A and B at the same time. However, be careful not to press Buttons A and B accidentally during the game or the screen will be cleared and you will have to start again!
Are the any other ways to speed this game up? What if Button A was assigned for some of the LEDs and Button B was assigned for the others? How could you describe this scenario in terms of probability?
Making a thermometer
The micro:bit can detect the temperature so making a thermometer is as easy as using the following code. An alternative to this could be to use a blue 'Forever' block so that the temperature is continually displayed and updated rather than having to press a button.
The micro:bit has an in-built accelerometer. This means that it can be used to detect motion, including being shaken. The following code is all that is required to make a dice.
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.