0% found this document useful (0 votes)
22 views

Grade 6-8 Dec

Uploaded by

seemaabdul2018
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)
22 views

Grade 6-8 Dec

Uploaded by

seemaabdul2018
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/ 51

AI AND ROBOTICS

GARDE 6-8
ABOUT SUPER AI POLARIS
CLASS PLAN -TERM 2
NOVEMBER

SESSION 1: INTRODUCTION TO THE SOFTWARE


SESSION 2: BACKDROP,COSTUME AND ANIMATION
SESSION 3: GETTING FAMILIAR WITH KIT
SESSION 4: VARIABLES AND OPERATORS
SESSION 1
INTRODUCTION TO PICTOBLOX SOFTWARE
HOW DOES TRAFFIC SIGNAL WORK?
Have you ever wondered how traffic signals function?
The traffic signals have 4 states:
No Lights
Red Light – STOP
Yellow Light – LOOK
Green Light – GO

The lights cycle through green, yellow, and red at regular intervals to control road intersections’
traffic flow.
The traffic signals work in sync to prevent accidents and help to avoid congestion on the roads.
HOW DOES TRAFFIC SIGNAL WORK? -
BEHIND THE SCENES
Few lines of code running in the background drive the traffic lights. The code
changes the traffic signals to show different colors at regular intervals.

Sometimes it is even smarter, where the code detects


congestion based on sensors and maximizes efficiency by only
functioning when traffic is present.
APPLICATION OF CODING
Interaction with bar-code scanners at shopping store
Automatic control of traffic using traffic lights
Booking movie, bus, train, flight tickets online
Printers
Computer software we use like web browser, Word, etc.
Video games and animations for entertainment
WHAT IS A PROGRAM?
A program is a set of instructions that a computer follows
to complete a task. The computer receives the information,
handles it, utilizes it, and then gives an output based on it
by following a program.
STEPS IN CODING
Planning the program
Writing the program in a programming
language into a code
Testing and debugging the program
PICTOBLOX: AN INTRODUCTION
PictoBlox is a graphical programming software based on Scratch blocks and is the ideal
companion for setting the first step into the world of programming.
PICTOBLOX INTERFACE
SESSION 2 :
CREATING ANIMATION
WHAT IS A BACKDROP?
A backdrop is one of the many frames, or backgrounds, that a Stage can have. The Stage
can change its look to any of its backdrops.

Choosing a Backdrop Open PictoBlox and create a New File.


You can choose a backdrop Select the coding environment as Block
from the backdrop library Coding.
uploading a file from the Click Choose the Backdrop and select
computer any backdrop you want.
creating one using the paint
editor Choose Backdrop
COSTUMES
A costume is one out of possibly many How to Create Costumes?
“frames” or alternate appearances of a There are four ways of getting a costume for a sprite or stage.
sprite. Sprites can change their look to From the costume library
any of their costumes. Every sprite has Drawing one yourself using the inbuilt paint editor
at least one costume. Getting an image or multiple images from your desktop
One of the most common uses of Taking an image using a webcam

costumes is to make an animation for a


game. You can use a number of
costumes to create one single
animation.
The costumes available for the sprite
are shown in the Costume tab, next to
the Code tab on the extreme left.
ACTIVITY 1: MAKING AN
ANIMATION IN PICTOBLOX
In this activity, we are going to create animations with
costumes.
Follow the steps below:
Create a New file in PictoBlox:
Follow the step if you are working on Windows, macOS, or
Linux:
Open PictoBlox and create a new file.
Select the coding environment as Block Coding.
Click Choose the Backdrop and select any backdrop you
want. We’re choosing the Forest backdrop (to make Tobi
feel at home).
Create the script of the walking animation made in the
previous session.
To change a sprite’s costume, PictoBlox has the switch
costume to () block available in the Looks palette.
ACTIVITY 2 : MAKING AN
ANIMATION IN PICTOBLOX
SESSION 3: GETTING STARTED
WITH QUARKY
HAVING FUN WITH QUARKY
Let’s get started with AI BRAIN KIT with a Getting Started activity. To do this
activity, first, we have to power on Quarky. We can do it with the USB C cable
that comes with the kit.

Plug the cable to QUARKY and to any of these:


Laptop
Power Adapter
Power Bank
STEP 2: EXPLORING THE TACTILE
SWITCHES
Quarky has 2 tactile switches labeled L and R. The program continues and you
will play a catch the fruit game using the tactile switches.
During this you will do the following:
Explore the tactile switch L and R.
Play a small game where the fruits come from the
top of the LED and you are at the last row of the
Display. You have to move left and right using the
L and R switches respectively and try to catch the
fruits. You have to catch 5 fruits to proceed
further.
STEP 3: EXPLORE TOUCH PINS
Quarky has 5 touch pins at the bottom labeled 1, 2, 3, 4, and 5. During this part,
you have to touch the pins and Quarky will make a sound and display lines. You
have to touch the pins 5 times to proceed further.
ACTIVITY 1: HAVING FUN WITH
EXPRESSIONS
ACTIVITY 2: NAME BADGE
SESSION 4 :
VARIABLES AND OPERATORS
VARIABLES

A variable is something that can take or store different


values as the program is executed.

Just as the same bowl is used to store different things, a


variable is used to store different values such as numbers
or words.
DATA TYPES

Data type identifies the type of data that the declared variable can hold is. Thus, it indirectly helps
the computer to understand what operations need to be performed on those variables.
The declaration of a variable in a program contains two components – the name of the variable and
its type.

Let us now understand what are the common data types that we can use in programming:
Integer
Floating-point number
Character
String
Boolean
NAMING RULES

As we have understood till now, variables in a programming language are basically like nouns. Every
variable in a program is unique. To identify these variables uniquely, the user needs to allocate them
a unique name. This name acts as an identifier for that variable. In programming, a user is not
allowed to use the same name of a variable more than once.
Naming variables make it easier to call them while performing operations. The name of a variable
also suggests what information the variable contains.
Below are some rules for naming a variable:
A variable name cannot start with a number, it must start with an alphabet or the underscore (_)
sign
A variable name is case-sensitive. Sum and sum are different variables
A variable can only contain alphanumeric characters and underscore
NAMING RULES

As we have understood till now, variables in a programming language are basically like nouns. Every
variable in a program is unique. To identify these variables uniquely, the user needs to allocate them
a unique name. This name acts as an identifier for that variable. In programming, a user is not
allowed to use the same name of a variable more than once.
Naming variables make it easier to call them while performing operations. The name of a variable
also suggests what information the variable contains.
Below are some rules for naming a variable:
A variable name cannot start with a number, it must start with an alphabet or the underscore (_)
sign
A variable name is case-sensitive. Sum and sum are different variables
A variable can only contain alphanumeric characters and underscore
VARIABLES IN PICTOBLOX

Let’s see how you can create a variable in PictoBlox. Follow the steps below:
1. Open the Variables palette.
2. Select Make a Variable.
3. The set () to () block will set the specified variable to the given value be it a string or number.
ACTIVITY: TRACKING A SPRITE’S
POSITION USING VARIABLES
1. Create two variables X and Y. We’ll use them for Tobi X
and Y positions respectively
2. Change the background to Xy- Grid to visualize the
position.
3. Add the when flag clicked block to start the script.
4. Next, set the X and Y positions as 0 by setting the X and
Y variables as 0 using the set () to () block.
5. Now, add a forever block below the when flag clicked
block.
6. Then, from the Motion palette, add a go to x:() y:() block
and drag and drop the X and Y variable blocks inside it
as shown. This will set Tobi’s position to the current
value of X and Y.
ACTIVITY: TRACKING A SPRITE’S
POSITION USING VARIABLES
1. To move left, we will change X by -10 whenever the left
key is pressed. Add a when () key pressed block from
the Events palette and change X by -10 by using a
change () by () block.
2. To move right, we will change X by 10 whenever the
right key is pressed. Repeat the above step and select
the right arrow key from the drop-down of the hat block
and change X by 10 in the change () by () block.
3. To move up, we will change Y by 10 whenever the up
key is pressed.
4. For down, we will change Y by -10 whenever the down
key is pressed
SESSION 5 :
ARITHMETIC OPERATORS
SESSION 6:
CONDITIONAL STATEMENTS
RELATIONAL OPERATORS
RELATIONAL OPERATORS
IF BLOCK
IF THE ELSE
LOGICAL OPERATORS - AND
IF (HOMEWORK COMPLETED) AND(TIME IS PAST 8 PM)
THEN
GO TO BED
ELSE
DO NOT GO TO BED
END
LOGICAL OPERATORS- OR
LOGICAL OPERATORS-NOT
SESSION 7:
NESTEDCONDITIONAL
STATEMENTS
ACTIVITY: THE REMAINDER PROBLEM
SESSION 8:
LOOPS
INTRODUCTION TO LOOPS
INTRODUCTION TO LOOPS
WHILE LOOPS
WHILE LOOPS
SESSION 9:
FOR LOOPS

You might also like