University of Gibraltar: UCL Teacher Training in Computer Science November 2016

Welcome to Teachers in Gibraltar

The Department of Education in conjunction with the Kosuma Trust and Gibraltar University has hosted a 3-day in-service training in Computer Science. It has been taught and lead by lecturers: Professor Stephen Hailes, Rae Harbird and David White from University College London which is the top ranked (Research Excellence Framework [REF]) university in Computer Science Research in the UK.

Hi there. Steve, Rae and I had a great time with you in your new University of Gibraltar in its beautiful setting. Thank you all for the warmth of the welcome we received. The intensity of your commitment to work made the delivery of the Course a rewarding experience for us.

We have set up a resource-gib page for further additions of material. It is referenced in the sidebar menu. Feel free to contribute — we would like to hear from you.
http://ispython.com/resource-gib/
Rae will be sending you by email copies of all the teaching materials (and more) that we used on the 3 day course in Computer Science. Rae has posted the BBC micro:bit booklet as a more public resource on the Computing at School (CAS) website, which we recommend you join. More material details on your resource-gib page.

University of Gibraltar: First Cohort of Teachers in Computer Science --- November 2016

(Click on the photo for enlargement and again for close-up)

University of Gibraltar: First Cohort of Teachers in Computer Science — November 2016

Click on Photo to Enlarge

Click on Photo to Enlarge

The ‘robots’ get to know each other by “bubble-sorting” themselves into first name alphabetical order in two rows and “merge sorting” themselves into a single line.

click on photo to enlarge

click on photo to enlarge

Rae helping with Programming in Scratch 2.0 to create patterns with regular geometric shapes

Building a robot from scratch. A study in focus, concentration and persistence...

(Click on the photo to see the detail, and again for close-up)

Building a “gib-robot” from scratch. A study in focus, concentration and persistence… Jackie and Stuart

Professor Steven Hailes

(Click on the photo to see the detail, and again for close-up)

Professor Steven Hailes, our robotics expert, explaining how to program a stepper motor with the micro:bit

click on photo to enlarge

click on photo to enlarge

Steve, is it a faulty component, the wiring, program error…?
click on photo to enlarge

click on photo to enlarge

The first robot, loaded with a Python program on the
BBC micro:bit, to draw a square.

Creating that robot from its basic components: stepper motors, micro:bit, ... and wires!

(Click on the photo to see the detail, and again for close-up)

Finally, our “gib-robot” ready to go, from its basic components: micro:bit, stepper motors, wheels, batteries, micro:bit edge connector, proximity sensor … and wires!

(Select full screen on the video, to see the wheels on the “gib-robot” turning in opposite directions to turn successfully the corner when drawing a square carrying a pen at the centre of the axis. Why does the robot have to turn in this way, when drawing a square? Why not keep one wheel stationary, and let the other make the turn? If you want to see what happens, attempt to draw the square both ways.)

Every journey starts with a first step. It may not look much … but doing the maths and writing the program to get the robot to make that first vital turn, necessary for drawing a simple square, is a moment of elation for the teams…

Twinkle, Twinkle on the Micro:bit in Python

With thanks to Nathan Russell who initiated it, and the ‘composition’ team for the programming ‘unplugged’ session on the bells, which led to a series of your successful Python programs playing the tune on the micro:bit.
I have added another Python program below (there’s always more than one solution!), which sets up the tune — represented as a data structure, tune --- a list of lists. Each of the internal lists representing a line of the tune — composed of the notes in the line. And the program plays the tune by tracing through tune with a for loop nested in a for loop:


from microbit import *
import music
# Twinkle Star: A python program with the tune stored as a nested list ---
# notes within lines within tune.

tune =
[
["c4:4","c4:4","g4:4","g4:4","a4:4","a4:4", "g4:8"],
["f4:4","f4:4","e4:4","e4:4","d4:4","d4:4", "c4:8"],
["g4:4","g4:4","f4:4","f4:4","e4:4","e4:4", "d4:8"],
["g4:4","g4:4","f4:4","f4:4","e4:4","e4:4", "d4:8"]
]

# note the indentations in the code below.
while True:
    for line in tune:
        for note in line:
            music.play(note)

Music in Scratch: Twinkle, Twinkle

This program’s structure and execution sequence speaks for itself:

Twinkle Twinkle in Scratch 2.0

Twinkle Twinkle in Scratch 2.0

Conversion Table: Musical Notes to Scratch Numeric Values

Scratch conversion table

Scratch conversion table

(Add or subtract 12 to go up or down an octave, respectively).

Further material will be posted on the resource-gib page: http://ispython.com/resource-gib/

Leave a Reply