Unit 5: Programming: 1st ESO: Technology, Programming and Robotics
Unit 5: Programming: 1st ESO: Technology, Programming and Robotics
Unit 5: Programming
Contents
Prior knowledge............................................................................................................ 2
Keywords...................................................................................................................... 2
Mindmap of the unit ..................................................................................................... 2
5.1.
Programming basics ......................................................................................... 3
5.2.
Example of IDE: Scratch.................................................................................. 4
5.2.1.
Introduction .................................................................................................. 4
5.2.2.
GUI (Interface) ............................................................................................. 4
5.2.3.
Example........................................................................................................ 5
5.3.
Programming apps for mobile devices: MIT App inventor ............................. 7
1st ESO
Unit 5: Programming
T.P.R.
Prior knowledge
Activity: Summarize your general knowledge on this topic.
Keywords
Activity: Copy following keywords, explaining their meaning and translate them into
Spanish.
Command
Flow diagram
IDE
compile
machine code
Bug
debug
Subroutine
Algorithm
GUI
duplicate
shrink
Variable
Backdrop
Sprite
Tab
Script
Event
Operator
Timer
Scoreboard
Random
Grid
Screenshot
CPU
Programming
languages
are
executed by
INSTRUCTIONS
consist of
PROGRAM
7.
is created in
a process:
1.PROBLEM
4.
programming
5.
compiling
6. Checking &
debugging
2.IDEA
these 3 stages are done in a
3.
flow diagram
Scratch
1st ESO
Unit 5: Programming
T.P.R.
1
Problem definition
IDE
4
Programming
2
Search of ideas
5
Compiling
3
Design (flow diagram)
Programming process:
1)Problem definition: Identify clearly the
needs.
2) Search for ideas: Choose the right
programming language and study the
needed algorithms (variables,
operations and formulas).
Flow diagram
Symbols
3) Design: Represent each
algorithm with a flow diagram
start / end
4) Programming (IDE): write the
program using the choosen
conector
language
5) Compiling (IDE).
Data
input /output
6) Checking and debugging
(IDE): run the program and if it
doesnt meet the needs (problem
decision
definition) fix the errors (bugs).
7) Saving and sharing (IDE).
process
6
Checking and debugging
yes
7
Saving and sharing
yes
E<3
no
Mean < 5
yes
no
Write: Mean
Write: failed
flow line
end
no
1st ESO
Unit 5: Programming
T.P.R.
Title
bar
Menu
bar
Script Costumes
tab
tab
Sound
tab
Toolbar
Screen
mode
Stage
Start /
Stop
and 4 areas:
commands
tabs: scripts /
costumes /
sounds
stage
object panes
Depending on the
object selected on
the panes (sprites
or backdrops), the
corresponding
information will
appear on the
tabs.
Commands
Scripts
area
Stage
backdrops
Sprites
pane
1st ESO
Unit 5: Programming
T.P.R.
5.2.3. Example
1)Problem definition: Its about programming a game similar to the classic pacman:
using the arrow keys to move, you have to guide a scissors within a maze to reach a
rioter.
1.1)
1.2)
1.3)
The scissors moves forward as long it is in contact with the mazes path
Whenever you push an arrow key, the scissors points in the direction you push
When the scissors reaches a rioter, a new rioter appears in another part.
Stage: Design or import a backdrop that you like and add a continuous music.
Sprites: a) scissors, b) the maze with the rioter
Subroutines: a) start the continuous music, b) to put the scissors in the starting
point and make it move if it is in contact with maze path, c) to rotate the scissors
with the keyboard, d) to change the rioters position if touched by the scissors
3) Design:
a: Music
start
start
play music
till end
Scissors
inside path
no
c: Scissor direction
yes
end
move forward
a stretch
d: Rioter position
start
Show scissors
closed
Wait a time period
end
reached
by scissors
yes
point in direction
0, 90, 180, 270
Show scissors
open
Wait a time period
no
, ,,
end
no
yes
Show next position
end
1st ESO
4) Programming
(IDE):
Unit 5: Programming
T.P.R.
4.1)
4.2)
4.3)
Stage: Import
the
background
and the music,
and program it
to play
continuosly
(subroutine a)
click to program
Use the when green flag is
clicked event to make play the
music when the program starts
Use the control block forever to
create a loop (part of a program
that repeats itself continuosly)
Sprites:
Design two
costumes for
the scissors,
and at least
two costumes
of rioters
appearing in
different
positions of the maze
Subroutines
for the
sprites:
program
subroutine b
and c for the
scissors and
subroutine d
for the maze
with the
rioter.
5) Compiling
(IDE).
6) Checking and
debugging (IDE):
Test, correct the
errors and check
that the program
meets the
requirements.
click to design
the different
costumes for
the sprites
7) Saving and sharing (IDE). Dont forget to shave the final program and if you want
to share it you can do it through the IDE.
1st ESO
Unit 5: Programming
T.P.R.
NOMOFOBIA
Note
book