[go: up one dir, main page]

0% found this document useful (0 votes)
7 views11 pages

Coding and Robotics GR9 T2

The document outlines the curriculum content for Grade 9, Term 2, focusing on computational thinking and coding activities, including creating a breakout game and a Scrabble score keeper. It emphasizes the application of coding skills through practical examples and introduces concepts of robotics and logical gates. Additionally, it covers the use of sensors and their applications in real-world scenarios, enhancing students' understanding of programming and robotics.

Uploaded by

kiarabalram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views11 pages

Coding and Robotics GR9 T2

The document outlines the curriculum content for Grade 9, Term 2, focusing on computational thinking and coding activities, including creating a breakout game and a Scrabble score keeper. It emphasizes the application of coding skills through practical examples and introduces concepts of robotics and logical gates. Additionally, it covers the use of sensors and their applications in real-world scenarios, enhancing students' understanding of programming and robotics.

Uploaded by

kiarabalram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11



3.3.2 Term 2
Content (Grade 9 / Term 2) Notes/Examples

CAPS
C.1 Apply computational thinking (CT) skills to develop a set of logical instructions to solve a problem. Link to C.2 – C.7 and R.5 – R.7
Example activity – Breakout game Note:
A breakout game consists of one paddle used to return a bouncing ball back and forth across the screen. The aim of the game is to break the bricks of a brick wall Learners use computational, what they have learned in
by getting the ball to hit/bounce on the bricks. breakout game in scratch | 101 computing coding as well as their experience from working through the
In pairs, work through the code below and create your own breakout game like the one below: example game to create their own game.
Step1: Paddle Step 2: This activity includes C..2, (creating code) C.3 (interpreting
code), C.4 (debugging code) and C.5 (evaluating their code
Use paddle sprite for improvement)
Add code to control paddle Add ball sprite Resize to
50
Add code for ball sprite

Step 3: Bouncing off paddle Step 4: Make variable for keeping score
Add code to ball sprite to make it bounce when it hits the paddle.
Make variable

Add code for paddle sprite to initialize score to


0 before game starts

Step 5: Add brick sprite Step 6:


Use button 3 for Create a variable,
brick. Number_of_Lives for paddle sprite
and initialize it to 3 when the game
starts.

Add a line sprite and position it


Duplicate brick to form 10 bricks. below the paddle.
Add code to the ball sprite to see if it hits the lifeline
(if it does, the player will lose a life and the ball will
Add code for brick to disappear when bounce back.
the ball hits it and increment score by 1

CODING AND ROBOTICS


when it happens.

Step 7: Add Game Over backdrop

135



Content (Grade 9 / Term 2) Notes/Examples

136
Add Game Over backdrop Load the program
Switch to Game Over backdrop Execute it and ensure that you understand the code.

C.2 Present a simple coding solution using symbolic or written statements representing sequences of commands, single repetition, and conditional Link to C.1, C.3-C.7 and R.5 – R.7
constructs.
Activity 1: Scratch Scrabble score keeper level 1 (String handling, determine length of a string, extract characters in a string)
In the game of Scrabble, you get a score according to the letters in the word that you place on the board.
The purpose of this program is to calculate the total for each word and keep the score by adding the total of all the words. Input a word and calculates the score for a
word. The letters are scored as follows: A = 1; B=2; C=3; D=4; etc.
If a word is longer than 6 letters, the first and last letters must count double points.
Examples:
• The word “computer” will score 132 (c=3x2)+(o=15)+(m=13)+(p=16)+(u=21)+(t=20)+(e=5)+(r=18x2)
• The word “strong” will score 93 (s=19)+(t=20)+(r=18)+(o=15)+(n=14)+(g=7)
Add the points that the player got to the player’s total.
For each word, display the points for the word as well as the player’s total at that stage
The program must allow the user to repeatedly place a word until the user has at least 100 points.
The program must also count how many words it took to reach a total of at least 100 points and display the number of words.

Activity 2: Scratch Scrabble score keeper level 2:


Expand the level 1 Scratch Scrabble score keeper for two Sprites to play against each other.
• The program inputs the name for each player.
• Each player gets a turn to choose a word (input a word).
• The first player who has a score of 100 points, wins the game. (The game will continue until a player has a total of at least 100 points.)
• If a player scores more than 50 for a word, the other player must say “Wow, well done!”

CURRICULUM AND ASSESSMENT POLICY STATEMENT


• Each Sprite’s total points must be updated each time.
• The Sprite who has at least 100 points first, wins the game.
Display the total scores for both players as well as the name of the winner.
C.3 Interpret and execute a given symbolic or written set of commands Link to C.1 and C.2
C.4 Debug a given symbolic or written set of instructions C.3 and C.4 are done with C.1 and C.2
Done with C.1 and C.2
C.5 Evaluate a given solution towards potential improvement
Example activity – Evaluate two programs with the same outcome Note:
Two sprites represent a program to break a number up into, e.g. thousands, hundreds, tens and ones, e.g. 6789 is displayed as 6000 + 700 + 80 + 9. However, the Learners may need guidance on this activity.
two programs use different approaches. Let pairs use a traceable for each program to describe and
explain how each program work.
In pairs, study the programs, describe and explain the method followed by each. Use a tractable to work through each program.
• Will this program work for any number (even bigger than 9999)? If yes, what needs to be changed to make it work for any number? There are similarities and differences between the programs.
• Evaluate each of the programs in terms of effectiveness.
• Pairs report back and share their discussions and findings. Pairs should answer the following questions after working
through the two programs:



Content (Grade 9 / Term 2) Notes/Examples


Program 1 Program 2 • When evaluating the programs, answer the following
questions
• How is the input to both programs different/the same?

CAPS
• How is the output of both programs different/the same?
• How are the loops (repeat structures) different/the same?
• For the same number, how many times will the loop in
each program execute?
• Which of the two programs will work with any number
(even bigger than 9999)?

Note:
It is important that learners understand that, in many
instances, a problem can be solved using different
approaches and/or tools.

C.6 Recognise and interpret patterns in symbolic sets of data or visualisations. Link to C.2 – C.5 and C.7, D.8 and D.9
C.7 Create or complete a pattern to represent a data set Do with C.6
Example activity – Fibonacci numbers C.6 and C.7 done together
Fibonacci numbers start with two predetermined terms and each term afterwards is the sum of
the preceding two terms.
The first two numbers are 0 and 1 (T1 = 0, T2= 1) and the next number is always the sum of the
previous two numbers
The first few Fibonacci numbers with signature (0,1) are 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89,
144…
(Note: The first two terms are the signature. The signature may vary.)

• Work through the program on the right to see if it displays the first 10 Fibonacci numbers

CODING AND ROBOTICS


correctly.
• Now, change the signature (the first to numbers to e.g., 1 and 2 and run the program to see
what happens.

137



Content (Grade 9 / Term 2) Notes/Examples

138
Robotics
R.3 Outline the different components of a robot Link to R.5 – R.7
Learners need to describe and use the following sensors: Introduce learners to sensors that provide analogue input,
Component Basic definition Purpose Practical application example – May be used to: e.g. soil moisture sensor, temperature sensor and humidity
Soil Moisture Sensor A sensor that measures the Employed in agricultural or gardening Monitors soil conditions for automated plant care sensor
moisture content in so robots to monitor soil conditions for systems in agricultural robots.
watering or plant care. Learners need to know the elementary difference between
digital and analogue input and how to process the readings in
block-based code
Temperature and Humidity Sensor: A sensor that measures both Enables climate control, Enables climate control, environmental monitoring,
temperature and humidity levels in environmental monitoring, and and weather reporting in robots.
the environment. weather reporting in robots.

R.5 Design a simple artefact based on a set of design instructions


R.6 Mimic the operations of a robot Link to R.5 and C.1 – C.7
Example activity - Soil moisture artefact with analogue sensor NOTE:
For version 2 (as opposed to the Grade 7 version), the learners are introduced to the concept of Analogue input (values 0 to 1023) vs Digital input (Binary – On and Analogue input pins on a microcontroller allow it to measure
Off / 0 or 1) continuous voltage levels, making it suitable for tasks like
For this version learners substitute the simple probes with a soil moisture sensor. reading sensor data such as light or temperature. Digital input
pins, on the other hand, are used for detecting binary signals
Soil moisture with sensor and analogue input like button presses or switch states, making them ideal for
https://www.tinkercad.com/blog/tinkercads-new-soil-moisture-sensor user interactions and simple on/off sensing.

Analogue input pins on a microcontroller typically have a


range of 0 to 1023, representing the full spectrum of voltage
levels they can measure, which makes them versatile for a
wide range of sensor applications.

Also see: Pins on the Micro: bit

CURRICULUM AND ASSESSMENT POLICY STATEMENT





Content (Grade 9 / Term 2) Notes/Examples

CAPS
Also see: (https://makecode.microbit.org/55671-93208-82700-45427) and https://makecode.microbit.org/reference/pins/map

In relation to the code the learners also need to know how to use
the MAP function as part of the block-based language used to map
ranges to single values from readings.

The Map function in MakeCode (mapping analogue data to digital ϬƚŽϭϬϮϯ


Ϭ Ϯϱϲ Ϯϱϲ Ϯϱϲ Ϯϱϲ ϭϬϮϯ
data)

ϬͲϮϱϱ ϮϱϲͲϱϭϭ ϱϭϮͲϳϲϳ ϳϲϳͲϭϬϮϯ

>Žǁ
DW
,ŝŐŚ

CODING AND ROBOTICS


Ϭ ϭ Ϯ ϯ

139



Content (Grade 9 / Term 2) Notes/Examples

140
Revisit logical gates and truth tables
The learners should present a basic understanding of the principles of:
• Boolean logic and
• Logical gates (AND, OR and NOT) and how it relates to the design, programming, and functioning of robotic systems.
The learners revisit the 3 ANSI symbols for the three logical gates.
NOT AND OR

The learners should be able to:


• represent a simple truth table for each of the gates.
• interpret a simple logical gate diagram comprising of no more than 3 inputs and a maximum of four gates to determine a single outcome. (Either true or false)
• complete a partially completed truth table.
• present a basic discussion of the operation of the circuit as well and its practical application, with real-world scenarios.
• setup and draw a simple logical gate circuit to present a real-life problem involving sensors (simple circuit with a maximum of three inputs) and a maximum of four gates.
Also see:
https://en.m.wikipedia.org/wiki/Logic_gate
https://learnlearn.uk/gcsecs/logic-gates/
https://www.bbc.co.uk/bitesize/guides/zkkkw6f/revision/1
http://www.bitsofbytes.co/exam-questions---logic-gates.html

Examples of scenarios
Scenario 1
Smart home application that automatically turns on a light bulb (actuator) in a room when it gets dark, but only if there is someone in the room. You have two sensors to accomplish
this: a light sensor and a motion sensor.
Example

An AND gate outputs a high (1) signal only when both of its inputs are high. In this context, we can use an AND gate to combine signals from both sensors, ensuring that the light
turns on only when it's dark (low light sensor reading) and there's motion (motion sensor detects someone).
▪ Light Sensor (LS) -> Input 1

CURRICULUM AND ASSESSMENT POLICY STATEMENT


▪ Motion Sensor (MS) -> Input 2
▪ AND Gate Output (Y) -> Actuator (Light Bulb)

LS MS Y (Light Bulb)
0 0 0 (Off)
0 1 0 (Off)
1 0 0 (Off)
1 1 1 (On)

Scenario 2
A parking lot entry gate with a boom gate and a ticket payment system. The gate should only open if two conditions are met: a customer has inserted a valid parking ticket, and a
sensor detects a vehicle waiting to exit.
The ticket payment system (TPS) verifies if a customer has inserted a valid parking ticket. It provides a binary signal (0 for invalid ticket, 1 for valid ticket).
The vehicle sensor (VS) detects the presence of a vehicle waiting to exit and provides a binary signal (0 for no vehicle, 1 for a vehicle detected).
The AND gate combines these signals. It outputs 1 only when both conditions are met (valid ticket and vehicle detected).
The NOT gate inverts the AND gate's output. If the AND gate outputs 1, the NOT gate will output 0 (opening the boom gate); if the AND gate outputs 0, the NOT gate will output 1
(keeping the boom gate closed).




Content (Grade 9 / Term 2) Notes/Examples


TPS VS Y (Boom Gate)
0 0 0 (Off)
0 1 0 (Off)

CAPS
1 0 0 (Off)
1 1 1 (On)

A NOT gate inverts its input signal. You can use a NOT gate to ensure the boom gate remains closed when the AND gate's output is 0 (i.e., both conditions are not met).

AND Gate Output (Y) -> Input


NOT Gate Output -> Boom Gate Control

Y (Boom Gate) NOT(Y) (Boom Gate)


0 1 (Open)
1 0 (Closed)
Circuit Operation:
The ticket payment system verifies if a customer has inserted a valid parking ticket. It provides a binary signal (0 for invalid ticket, 1 for valid ticket).
The vehicle sensor detects the presence of a vehicle waiting to exit and provides a binary signal (0 for no vehicle, 1 for a vehicle detected).
The AND gate combines these signals. It outputs 1 only when both conditions are met (valid ticket and vehicle detected).
The NOT gate inverts the AND gate's output. If the AND gate outputs 1, the NOT gate will output 0 (opening the boom gate); if the AND gate outputs 0, the NOT gate will output 1
(keeping the boom gate closed).
Application:
- A customer inserts a valid parking ticket (TPS=1).
- A vehicle is detected by the sensor (VS=1).
- The AND gate receives both inputs as 1 and outputs 1.
- The NOT gate inverts the AND gate's output, resulting in a 0.
- The boom gate is controlled by the NOT gate's output, so it opens.
- This example illustrates how logical gates and circuits can be used to control access to a parking lot by ensuring that customers pay for a ticket before the boom gate opens,
enhancing security and revenue collection.
Scenario 3
Imagine you have a security system for a vault that requires the correct combination of three inputs (A, B, and C) to unlock the vault door. You want to use logical gates to control
whether the vault door V is open or closed.

A B C D (A AND B) V (Vault) (C AND C)


0 0 0 0 0 (Closed)
0 0 1 0 0 (Closed)
0 1 0 0 0 (Closed)
0 1 1 0 0 (Closed)
1 0 0 0 0 (Closed)
1 0 1 0 0 (Closed)
1 1 0 1 0 (Closed)
1 1 1 1 1 (Open)

Example of a truth table and a logic circuit (with 3 inputs and a maximum of 4 gates)

CODING AND ROBOTICS


141



Content (Grade 9 / Term 2) Notes/Examples

142
A B C D (NOT A) E (NOT C) F (D OR B) G (F AND E)
0 0 0 1 1 1 1
0 0 1 1 0 1 0
0 1 0 1 1 1 1
0 1 1 1 0 1 0
1 0 0 0 1 0 0
1 0 1 0 0 0 0
1 1 0 0 1 1 1
1 1 1 0 0 1 0
Experiments / The learners must be able to apply the principles of design thinking to develop an artefact where a relay or transistor is used as a
Projects switch and a sensor to activate a device such as a DC water pump. Such an experiment or project could be a self-watering plant or an
automatic biltong drier with humidity sensor.

Source (https://www.instructables.com/Automatic-Plant-Watering-System-Using-a-Microbit/)

Automatic Biltong Drier, where a humidity sensor and temperature sensor regulates the fan.

CURRICULUM AND ASSESSMENT POLICY STATEMENT


Image source:
https://preview.redd.it/8uxo4lob0tk41.jpg?width=1080&crop=smart&auto=webp&s=a90c517242dfb64eb14a3756f18cf0a5c7cb9d9e
R.7 Create, test and execute a set of robotic instructions
Example activity 1 – Flappy bird game
The learners need to create a game that is based on the Flappy Bird game. The “object” (bird) must fly through open spaces in a maze.
How the game must work:
• When both buttons A and B are pressed, a maze must be displayed, with the “bird” in the bottom left corner.
• One LED will act as the “bird” and will start in the bottom left corner. The “bird” LED must display with a higher intensity than the other LED lights.
• Generate a random pattern of LED’s displayed on the screen to simulate a maze. These LED’s must display in a lower intensity than the “bird”.
• When button B is pressed the “bird” must navigate through the maze until it reaches the Y-coordinate of 4 (the fifth column).
• When the “bird” hits a wall (or an LED light), an “X” must be displayed to indicate “game over”.



Content (Grade 9 / Term 2) Notes/Examples


Digital Concepts
D.1 Outline the concept of technology and purpose of information technology (IT) Done with D.2 and D.3.
Introduce the Internet of Things (IoT) Introduction to Internet of Things (IoT)

CAPS
The Internet of Things (IoT) refers to a network of interconnected physical devices or "things" that are embedded with sensors, software, and other technologies to Link to the concept of networks
collect and exchange data over the internet or other communication networks. These devices can range from everyday objects such as online cameras, security Learners need to understand
devices, vehicles, and wearable gadgets to industrial machines and infrastructure components. • What the IoT is
IoT relies on infrastructure, including networks, servers, and cloud computing, to enable data communication and processing. IT systems provide the backbone for • Basic components of IoT
IoT to function effectively. • Computing devices that enable the IoT
Example activity – Introduction to IoT • Challenges with IoT such as privacy and security
Divide learners into small groups/pairs
Learners watch the following videos https://youtu.be/ps9ucSDH8s4 and https://youtu.be/6mBO2vqLv38
Each leaner completes a KWLS chart and report back
D.2 Recognise that he or she is living as citizens in a digital world. Done with D.4, D.6.
Ethical implications of IoT include security, privacy, and ethical considerations. Link to D.1
Example activity – IoT, cybersecurity and privacy
In pairs learners watch the following video https://youtu.be/4XycTona5qI and https://youtu.be/u1ymmRQ_p3k and complete a KWLS chart
Discuss issues related to IoT:
• Cybersecurity: IoT devices are vulnerable to cyberattacks
• Privacy and data collection: IoT devices collect vast amounts of data, often including personal information. Users may not always have control over the data
generated by IoT devices. Discussion of who collects and owns this data.
D.3 Demonstrate an understanding of the concept of a computing device. Done with D.1.
D.4 Identify the common uses of ICT in the real world.
Describe the concept of the Internet of Things (IoT) and explain how it connects physical devices and data.
Common uses of IoT:
• Smart Homes: IoT helps control lights, thermostats, and security in homes.
• Healthcare: It's used for remote patient monitoring and fitness trackers.
• Agriculture: IoT helps farmers with things like crop health and animal tracking.
• Transportation: IoT is used in cars and trucks for navigation and safety.
• Energy Savings: IoT helps save energy in homes and manages electricity grids.
• Environmental Monitoring: It's used to check air and water quality and protect wildlife.
• Smart Cities: IoT manages traffic and waste in cities.
• Building Control: It helps with things like lighting and heating in offices.
D.5 Differentiate between the components of an ICT system Link to D.4, D,7 and C.7, R.3 – R.7
Identify the key components of an IoT system: Reference to Rs.
• Devices: Physical objects connected to the internet that can be used to collect
and exchange data
• Sensors: These collect data, e.g. temperature sensor, movement
• Actuators: These perform actions based on data, e.g. a thermostat that adjusts

CODING AND ROBOTICS


the heat
• Microcontrollers/Microprocessor:

143



Content (Grade 9 / Term 2) Notes/Examples

144
D.6 Explain how the adaptation of technology impacted the world we work and live in Link to D,4, D.5 and R.1 – R.7
Internet of Things link to Rs D.5 and D.8 done together
Example Activity – Use KWLS chart to learn more about IoT Link to Rs
Provide learners with a KWLS chart on paper. Learners compete the first two columns (what I know and what I want to know), then learners watch the following Learners need to
video: https://youtu.be/6mBO2vqLv38?t=36 • Understand what the IoT is
Learners then complete the last two columns of the KWLS chart while watching the video. • Understand what the basic components of IoT is
• Understand how it impacts our lives
Discuss the following example of an IoT device: • Provide an example
Example Impact
For example, let's take a smart fridge. This fridge is part of the Internet of Things because it IoT makes virtually everything "smart". The IoT is gradually
has sensors inside that can detect how cold it is, how full it is, and what items are inside. It becoming one of the most prominent ICT technologies that
can then send this information over the internet to your phone or computer. So, if you're at underpin our society. It presents a unique technology
the grocery store and forgot to make a shopping list, you can check your phone to see transition that is impacting all our lives. Some people refer to
what's inside your smart fridge. it as Internet of Everything.
Link to microcontrollers (Rs)
https://youtu.be/6mBO2vqLv38 The Internet of Things (IoT) describes the network of physical
https://youtu.be/_AlcRoqS65E objects - “things”—that are embedded with sensors, software,
What is IoT? - A Simple Explanation of the Internet of Things (iotforall.com) and other technologies for the purpose of connecting and
https://bit.ly/3owhfZF exchanging data with other devices and systems over the
internet. These devices range from ordinary household
objects to sophisticated industrial tools.
Refer to any object that is connected to the internet and
can exchange information with other devices online.
D.7 Present a basic understanding of the concept of input processing and output. Link to D.4, D.5, D.6 and Rs.
Example activity - The process of how sensors measure data, transmit it to a microcontroller, and trigger an actuator Do in relation to Rs.
Provide learners with the following diagram: Also link to IPO tables

Learners need to
• understand input, processing and output with regards to

CURRICULUM AND ASSESSMENT POLICY STATEMENT


microcontrollers
• distinguish between digital and analogue in terms of input
.
and output
• describe the process involved in how sensors measure
data, is sent to the microcontroller and executed by the
actuator

Digital uses discrete steps, like light switches (two states), to


represent information, while analogue is like a continuous
flow, such as turning up the volume on a radio. Both have
their uses in the world of technology and can be found in
Revise and explain the concept of input, process, output concept with reference to IoT. various devices all around us.
• Sensors are devices that detect and measure physical properties or environmental conditions, such as temperature, light, pressure, or motion
Think of a digital system as a series of tiny switches that can
• Some sensors generate analogue signals in response to the physical property they are sensing. Analog signals are continuous and vary smoothly (e.g. turning
be either on or off, like a light switch. In the digital world,
the volume of a radio up or down).
everything is represented using these on-off switches. Each
• As computing devices work with binary, analogue data needs to be converted or mapped to digital data



Content (Grade 9 / Term 2) Notes/Examples


Measure data experiment Acceleration (Speed) project switch is like a tiny piece of information, called a "bit." When
Using the accelerometer to obtain readings - Simple geared DC motor buggy. Micro: bit Application using accelerometer readings in an array (list) in short intervals. you put many bits together, you can represent more complex
The microcontroller is attached to the buggy using Prestik or tape for the experiment. things, like numbers, letters, pictures, and sounds

CAPS
Analogue, on the other hand, is more like a smooth,
continuous flow. Imagine a dimmer switch for a light instead
of a simple on-off switch. With an analogue system, things
can have any value within a range, and there are no discrete
steps. It's like turning up the volume on a radio; you can have
it at any level you want, not just loud or quiet.

Display the recorded readings.

Alternate experiment (Rocket) Also see: https://makecode.microbit.org/courses/ucp-science/rocket-


acceleration/overview
D.8 Interpret a pattern to represent or communicate a message or image D.8 and D.9 done together.
D.9 Create a pattern to represent or communicate a message or image Link to C.6 and C.7
Example activity 1: - Convert ASCII code to binary. Revise binary code.
Explain what ASCII (American Standard Code for Information Interchange) is and its role in representing characters in computers. Mention that each character has a
unique decimal value assigned to it.
Show an example of ASCII art (simple drawings or patterns created using ASCII characters). Explain that the challenge is to decode ASCII art into binary.
Divide the learners into teams or pairs, depending on the group size. Provide each team with a different piece of ASCII art and a corresponding list of ASCII
characters and decimal values.
Their task is to decode the ASCII art into binary by finding the decimal values for each character and converting them. They can use coloured markers or pencils to
make the binary representation visually engaging.

Example activity 2: - Extend the activity to create bingo cards with ASCII characters and their corresponding binary values.

CODING AND ROBOTICS


Call out ASCII characters, and learners mark the corresponding binary values on their Bingo cards.
D.10 Demonstrate a basic proficiency in the application of digital skills. Link to C.2 – C.5, and R.5 – R.7
Learners develop a presentation (PP) about using/applying the use of an IoT device (Link to Ds above). Link to networks (IoT)
Example: Live webcam e.g. Explore Africa Example connecting to and watching the feed on a IoT device: https://youtu.be/VUJbDTIYlM4

145


You might also like