Programming project - Sense HAT II
I can randomly generate pixel colours and use this to create a fortune-telling ball.
Programming project - Sense HAT II
I can randomly generate pixel colours and use this to create a fortune-telling ball.
These resources will be removed by end of Summer Term 2025.
Switch to our new teaching resources now - designed by teachers and leading subject experts, and tested in classrooms.
These resources were created for remote use during the pandemic and are not designed for classroom teaching.
Lesson details
Key learning points
- Static data structures reserve memory locations for a set amount of data. Their size cannot change.
- Dynamic data structures are more flexible. The memory capacity is not fixed.
- The choice() function can be used to randomly choose an item from a list.
- For example, it could randomly pick a pixel from a list storing all pixels in an LED matrix.
Keywords
Append - add to an existing data structure
Pixel - a single element of an image on a computer screen
Common misconception
A list is static, so once it is created it cannot be edited or amended.
A list is a dynamic data structure that can change in size. The append() function can be used to add elements to a list.
To help you plan your year 10 computer science lesson on: Programming project - Sense HAT II, download all teaching resources for free and adapt to suit your pupils' needs...
To help you plan your year 10 computer science lesson on: Programming project - Sense HAT II, download all teaching resources for free and adapt to suit your pupils' needs.
The starter quiz will activate and check your pupils' prior knowledge, with versions available both with and without answers in PDF format.
We use learning cycles to break down learning into key concepts or ideas linked to the learning outcome. Each learning cycle features explanations with checks for understanding and practice tasks with feedback. All of this is found in our slide decks, ready for you to download and edit. The practice tasks are also available as printable worksheets and some lessons have additional materials with extra material you might need for teaching the lesson.
The assessment exit quiz will test your pupils' understanding of the key learning points.
Our video is a tool for planning, showing how other teachers might teach the lesson, offering helpful tips, modelled explanations and inspiration for your own delivery in the classroom. Plus, you can set it as homework or revision for pupils and keep their learning on track by sharing an online pupil version of this lesson.
Explore more key stage 4 computer science lessons from the Programming: strings and lists unit, dive into the full secondary computer science curriculum, or learn more about lesson planning.
Equipment
All pupils require access to the Raspberry Pi Code Editor. Pupils could use the physical components of a Raspberry Pi computer and a Sense HAT for this lesson, but they are not essential.
Licence
Prior knowledge starter quiz
6 Questions
Q1.What is the main advantage of using the Sense HAT emulator?
Q2.Which of these is a feature of the Sense HAT?
Q3.Why might you use a list when working with the LED matrix?
Q4.What is the part of the Sense HAT that detects things like temperature or movement?
Q5.Match each action to what it does, to complete the sentences:
... lets you use hardware in code.
... controls pixel colours.
... executes instructions.
... tests your program digitally.
Q6.What does the HAT stand for in SenseHAT?
Assessment exit quiz
6 Questions
Q1.What is the name for the smallest single part of an image on a computer screen?
Q2.What statement describes a static data structure?
Q3.What function would you use to add an item to a list in Python?
Q4.Which statement about lists in Python is true?
Q5.Match each action to its description:
adds to a list
picks an item at random
fixed size
flexible size