Using the BBC micro:bit as an output
In this system, the BBC micro:bit acts as both an input and an output device. The use of the button is inputting information, but the primary function of the BBC micro:bit is to give output information, such as lighting the light emitting diodes (LEDs) on the traffic light and displaying information on its own LEDs.
Below, I have developed some activities that can develop learners understanding of programming output devices. These activities will help children to develop their understanding of physical computer systems, algorithms, sequencing, debugging, selection, repetition and decomposition.
|
Cross Curricular LinksAs learners develop their understanding of physical computer systems, it is useful to give them opportunities to apply their understanding in a meaningful context. This can be easily done using a traffic light project. As with the input project, this links well with the Design and Technology National Curriculum.
|
Activity One: Unplugged Traffic Light Algorithms
I suggest that this should be structured by the teacher, scaffolding the decomposition. Displayed are some example stages for developing the plan for controlling the traffic lights.
Stage One The first step is to order the lights turning on and off. In the example, I have used traffic lights that do not flash, as this is a more complex algorithm that will be looked at in a later stage. Concepts and Skills developed:
Stage Three Moving on, learners will add a selection and a repetition loop to determine whether the button has been pressed for pedestrians to cross the road. Concepts and Skills developed:
|
Stage Two Next the learners should consider where pauses are used in the algorithm. Concepts and Skills developed:
Stage Four The next step is for learners to add additional outputs in the form of pedestrian instructions. Concepts and Skills developed:
|
Stage Five
In this stage, the learners should be challenged to use a repetition loop to create flashing amber lights. This feeds directly into the second activity, as that challenges the children to create a flashing amber light within the JavaScript Block Editor. The full image of this completed unplugged algorithm is downloadable.
|
Stage Six It is key that the learners understand the importance of the forever loop in this algorithm, as it is what instructs the program to constantly check wither the button has been pressed. Without this, the traffic lights will complete one loop and then not respond to the button being pressed again. Concepts and Skills developed:
|
Activity Two: Flashing YellowThe flashing light problem can be planned out using the unplugged activity above, and then developed on the BBC's JavaScript Block Editor.
|
Activity Three: Pedestrian DebuggingThe final activity requires learners to debug a faulty traffic light system that doesn't show pedestrians the symbols they are meant to see at the right time. The sample of code shown has the different blocks in place to change the pedestrian signs, but the current instructions have the 'walk' instruction appear when the amber light is on, and the flashing amber has no pedestrian instructions alongside it.
|