Coding and Robotics GR8 T2
Coding and Robotics GR8 T2
3.2.2 Term 2
102
Content (Grade 8 / Term 2) Notes/Examples
Coding
C.1 Apply computational thinking (CT) skills to develop a set of logical instructions to solve a problem. Link to C.1 – C.7
Example activity Remember
ZĞŵĞŵďĞƌ͗
Divide learners into pairs. Sequence and detail
Each pair solves the following problem using computational thinking. An algorithm is an ordered list of well-defined steps or Sequencing is putting events or information in a specific
Problem: instructions that you can follow to perform a task or order. It is the skill that helps you to plan what steps to take
You need to find a picture on the Internet which you want to use as a sprite in your block-based solve a problem. to perform a task successfully.
application. These instructions are often expressed as something Detail means considering every aspect or minor part of
Use computational thinking to describe the steps you will follow (develop an algorithm) to realise that humans can understand. Eventually, these something. It is to describe or give exact information about
this. Take note of the characteristics of a good algorithm when designing your instructions. instructions must be translated into a sequence of something. The steps or instructions to perform a task need
computer instructions using enough detail so the to be unambiguous – they need to be precise and clear to
Pairs swop instructions/algorithms and test to see if the other pair’s instructions work correctly. They computer can execute the instructions. avoid misinterpretation or different interpretations by different
now act a s the computer and follows the instructions to the letter. Each pair adds comments for the people.
other pair, if necessary, to fix or improve their instructions. Developing an algorithm How are sequence and detail helpful?
To develop an algorithm, you must identify what needs In sequencing, we learn about patterns in relationships. We
Pairs return turn the instructions with comments to the original pair to fix or improve if necessary. to be done (the instructions) and the order in which also learn to understand the order of things. By learning to
they must be done. sequence, we develop the ability to understand and arrange
When developing an algorithm, each instruction is purposeful patterns of actions, behaviours, ideas, or
identified and the sequence in which the instructions thoughts.
are carried out, is planned and must be logical. Attention to detail is important because it helps prevent
mistakes and ensures the successful completion of a task.
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
constructs.
CAPS
2. Get the test total (Total marks for test)
3. Calculate the percentage
4. If percentage is more than 30, you have passed, else you have failed
Study the following IPO table and determine if the algorithm is correct
You can represent the above instructions/algorithm using a flowchart:
Example activity 2
Convert the flowchart into block-based code.
Run the program, test and debug
104
C.3 Interpret and execute a given symbolic or written set of commands Link toC.4
Example activity – Trace code to explain what it does Note:
Use a trace table to work through the following program and It is important that coding activities revise coding concepts
explain what it does learned in previous terms and grades cumulatively, using
different activities and combinations of concepts.
Note:
Literature suggests that the biggest problem of novice
programmers does not seem to be the understanding of
basic coding concepts but rather learning to apply them.
Therefore, at this level, beware of giving learners
programming tasks that combine too many concepts
(Robins, 2019).
• Underweight = <18.5 While learners need to debug all the code the write, learners
• Normal weight = 18.5–24.9 must also be provided with incorrect code which they need to
• Overweight = 25–29.9 debug.
• Obesity = BMI of 30 or greater
Get a person’s weight (in kg) and height (in m), then determine if the person is overweight or not.
Display a message to that will inform a person if he/she is underweight, normal weight, overweight or obese.
CAPS
C.6 Recognise and interpret patterns in symbolic sets of data or visualisations. Link to C.1, C.2 and D.6 and D.7L
Example activity – Interpret a pattern You want to interleave practise in problems.
Divide learners into pairs. “It is important that problem types must differ, for example,
The driver receives the code on the right on paper you want to randomly have a problem of one type and then
The navigator receives a blank page and a pen/pencil. solve a problem of another type and then a problem of
The driver reads the code, calls out the code and acts out the instructions (the driver may ignore acting out the pen another type. And in doing that, it feels difficult, and it doesn’t
instructions but still calls out the pen instructions for the navigator who holds the pen/pencil) feel fluent. And the signals to your brain are, I am not getting
As the driver calls out and acts out an instruction, the navigator draws the instruction on paper. this. I am not doing very well. But in fact, that effort to try to
The navigator must also hold count of the number of times a loop is executed and must tell the driver when to exit the loop. figure out what kinds of approaches do I need for each
Both the driver and the navigator must also hold count of the variable (length) contents to ensure the instructions are carried problem as I encounter a different kind of problem, that is
out correctly. producing learning. That is producing robust skills that stick
When done, the driver copies the code to a block-based coding app, runs the code on the computer and the navigator with you.”
compares the result with the drawing made during acting out process. Dr Mark A. McDaniel, Harvard University
If the navigator’s drawing is incorrect, the pair need to determine where they misinterpreted the code, or they can switch
roles and repeat the exercise to determine where they went wrong.
106
C.7 Create or complete a pattern to represent a data set
Example activity - Create a pattern Note:
An embroidery machine uses the following commands for creating patterns: This task is an example of how an algorithm can be used to
OUT (cc)-IN (dd), where cc and dd indicate the position of the needle in the grid. create a pattern by an embroidery machine.
Example: An algorithm describes the steps we follow to complete a
OUT(E6)-IN(G8) moves the needle to the E6 position and pulls the cotton thread through the fabric from behind. The needle then task. Algorithms are common in computer science, but
moves to the G8 position and pushes the thread from the front through to the back. The following two commands create a pattern outside computer science algorithms may play a role in
like the one below: OUT(E6)-IN(G8); OUT(E2)-IN (E4 solving everyday life problems.
Create an embroidery pattern by programming instructions for his embroidery machine.
By identifying patterns, we can predict what will come next
and what will happen again and again in the same way.
Write down the set of commands that will complete the following pattern In Computer Science/coding we analyse patterns in data and
2020-Talent-Search-Solutions-book.pdf (olympiad.org.za) make predictions and generalisations based on the pattern
analysis.
Robotics
R.3 Outline the different components of a robot
Introduce the RGB LED in detail. Introduce Boolean logic and logical gates.
Component Basic definition Purpose Practical application example – May be used to:
RGB LED (Red, An LED capable of emitting Used for colour indication, lighting Used to display colours or convey information through Learners understand the principles of
Green, Blue LED): different colours by varying the effects, and display purposes in robots. different colour combinations. • Boolean logic
intensity of its red, green, and blue • Logical gates (AND, OR and NOT)
components. • How it relates to the design, programming and functioning
of robotic systems
Boolean Logic: Logical Gates:
Boolean logic is a fundamental branch of mathematics and logic developed by Logical gates are electronic circuits that implement Boolean logic operations. Learners can
George Boole in the mid-19th century. It deals with true and false values, They take one or more binary inputs and produce an output based on the • Represent a simple truth table for the AND, OR and NOT
The learners are introduced to the 3 ANSI symbols for the three logical gates.
NOT AND OR
CAPS
Equivalent build by learner (In
this example two position
slide switches was not
available and simple push
Note: Breadboard design (given to learners) buttons were used)
The mixing of colours and the truth table
Z ' ZĞƐƵůƚ
Ϭ Ϭ Ϭ Ϭ
Ϭ Ϭ ϭ
Ϭ ϭ Ϭ
Ϭ ϭ ϭ
ϭ Ϭ Ϭ
ϭ Ϭ ϭ
ϭ ϭ Ϭ
ϭ ϭ ϭ
Project 2 (Micro: bit + RGB)
Digital and analogue pin output
Introduce the learners to the concept of digital pin vs analogue pin output.
Differentiate between digital and analogue pin output and how it is used in robotics or physical computing applications.
Basic Definition Purpose Usage in Robotics, in respect of a (Microcontroller)
Digital pin output Digital pins on a microcontroller are Digital pins are primarily used for In robotics projects with a microcontroller, digital pins can
used for sending digital signals, tasks that involve binary on/off be used to control various components such as LEDs,
Ϭ which can have only two possible control, like turning an LED on or servos, motors, and relays. For instance, you can use a
states: HIGH (1) or LOW (0). off, controlling a motor's direction, digital pin to turn on or off an LED to indicate the robot's
or sending digital signals to other status or activate a motor for a specific robotic movement.
ϭ digital devices.
Analogue pin output Analog pins on a microcontroller can Analog pins are typically used for In robotics, analogue pins on a microcontroller can be
107
108
In the following simulated example random values are chosen to be passed as analogue values to each of the pins to an RGB LED resulting in a different random
colour being displayed by the LED.
CAPS
R.4 – Present an understanding of how robots affect the world. Link to R.1, R.2 and R.3
Example activity –How they affect the world The learners should be able to:
Provide learners with videos to watch, e.g. https://youtu.be/_Lad2u931Cw and https://youtu.be/I4iW-L5J7dg and a KWLS chart. • present a basic understanding and consider the potential
Learners watch videos and complete the KWLS chart ethical dilemmas related to robotic technologies, such as
Now, divide learner into pairs. Each pair identify a field/type of robots, e.g. the hospitality industry, discuss advantages/disadvantages and what ethical dilemmas privacy concerns, AI bias, jobs, and the responsibility for
might occur actions performed by autonomous robots.
• present a basic description and understanding of robot
programming and its role in automation and how it plays a
significant role in robot functionality and their integration
into various industries.
R.7 Create, test and execute a set of robotic instructions Link to R.5 and R.6
109
110
Example activity 2 “catch the dot” game. It is a good idea to quickly revise the knowledge and skills
The purpose of this game is to navigate a basket (LED bar) to “catch” other LED lights. required for the new coding environment by linking it to the
Press both buttons to start the game. first coding environment learned and explain how it works in
Create a “basket” or “bar” that is 3 LED lights long. The basket displays at the bottom of the screen when the game starts. the new environment.
Display a random dot on the microcontroller for a random number of seconds. Move the basket with up-, down-, left- and right arrows to “catch” the dot.
Repeat the game 10 times (or as many times as you want to).
When Button A is pressed, display the number of dots that you caught with the basket.
The POPI Act is like a protector of your personal information. It makes sure that your information is treated carefully and respectfully by companies and
organizations. Just like you want your secret diary to be safe and private, the POPI Act helps keep your personal information safe and private tool
Now, divide learners into small groups.
Provide each group with information on POPIA as well as copyright with questions they need to answer.
Groups report on the following:
• What the POPI act is
• What copyright is
• Why sources should be referenced
• How to protect personal information
CAPS
• URL (Uniform Resource Locator) – A web address that is unique to each resource on the web. It could be the address of a webpage or an image file WWW concepts:
• Hyperlink – links to other webpages • Website
• Web server – A computer where files are stored which can be accessed via the internet using HTTP • Webpage
• Browser – used to access websites and web pages. It allows you to • Web server
see HTML document as a beautiful document e.g. Edge, Chrome. It • Browser
interprets HTML code to display images, etc. • Search engine
• Search engine – used to search for specific information on the web • URL
within the browser, e.g. Google, Bing • Hyperlink
Example activity – Explore Web concepts Learners need to provide an example of
Provide learners with a KWLS table on a worksheet • URL
Learners watch the following videos and complete the columns in the • Browser
KWLS chart • Search engine
https://youtu.be/X6DIH7b82Qw • Website
https://youtu.be/AGGWCbMvOxA Learners need to distinguish between a website and a
https://youtu.be/-U-j88slQUk or https://youtu.be/d15SBe3diu4 webpage
D.6 Explain how the adaptation of technology impacted the world we work and live in Link to D.2
Example activity - Importance of the WWW Learners need to understand
• Define the concept of the World Wide Web (WWW) and its role in the broader context of the internet. • what the WWW is
• Explain how the WWW facilitates communication, collaboration, and information sharing among individuals and organisations. • how it facilitates communication, information sharing and
• The world wide web opened the internet to everyone, not just scientists. collaboration
• It connected the world in a way that was not possible before and made it much easier for people to get information, share and communicate.
• It allowed people to share their work and thoughts through social networking sites, blogs and video sharing.
D.7 Present a basic understanding of the concept of input processing and output. Link to C.2 – C.5
Understand how the Information Processing Cycle relates to networks in terms of Input, output, processing, storage and communication (link to coding & robotics) Revise information processing cycle
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.5 – C.7
Use algorithms and transfer to block-based coding Red (R) Green (G) Blue (B) Colour Possible
Example activity: 0 0 0 Black solution:
Use the following algorithm to ask for a binary number and display the corresponding button in the colour 0 0 1 Blue
as shown in the table below.
0 1 0 Green
Use the table to determine the outcome.
1. Create costumes for each colour in the table above. Number the costumes from 1. 0 1 1 Cyan
2. Ask for a Binary number. 1 0 1 Magenta
3. Read and store the input binary code. 1 1 0 Yellow
4. If the first letter of the binary code entered is equal to 1, add 4 to the variable. 1 1 1 White
111