Download presentation
Presentation is loading. Please wait.
1
Introduction to Scratch
2
Session 1. What is Programming
3
What is Programming? Programming is to instruct computer to work. You can program and create: Apps Games Animations
4
Scratch Scratch is the language you program to create stories, animations and games.
5
Let’s Start Step 1. Open browser and goto “scratch.mit.edu”
6
Let’s Start Step 2. Type in your Username and Password (written on the paper) Step 3. Click “Create”
7
Try this! Step 1: Click “Sound” at Scripts
Step 2: Drag “play sound meow until done” block to here
8
Try this! Step 5. Click the green flag Step 3. Click at “Events”
Step 4. Drag this block and put on top of play sound block.
9
Congratulations! You just created your first program!
All Program should start with a Hat block. This tells the Program to start when Green Flag is clicked! This tells what Program should do, and you make the cat meow!
10
Try this! Step 3. Click Green Flag
Step 2. Drag “say Hello! for 2 secs” to under “when green flag clicked” block Step 1. Click “Looks”
11
Explore! Change the number of seconds as below and see what happens!?
12
Try this! Step 2. Click Green Flag
Step 1. Drag “play sound meow until done” to below “say Hello! for 2 secs”
13
Try this! Step 4. Click Green Flag
Step 3. Drag “play sound meow until done” to above “say Hello! for 2 secs”
14
Sequencing Why is the difference?
You can add blocks above or below any other blocks, and they always run step by step from top to bottom.
15
3 things to remember.. 1. Use Hat Block to start a program
2. Program always run from top to bottom 3. Select the character you want to program
16
Repeat Block Repeat block repeats “inside blocks” for a number of times. Repeat how many times Inside Blocks
17
How many times does boy say “Hello”?
forever
18
mBot
19
超聲波傳感器 (Ultrasonic Sensor)
20
Distance Detection 超聲波亦可以用來測量物件與障礙物的距離。
原理是物件向著障礙物發出超聲波,超聲波在空氣中傳播,並碰到障礙物後返回來。根據超聲波一來一回的時間來量度物件與障礙物的距離。
21
Ultrasonic sensor Step 1. Add these commands and click Green Flag.
Step 2. Move your hand away or towards the ultrasonic sensor, and observe what happens to the distance variable.
22
Exercise Program the mBot to keep moving forward, but stop when there is object in its way.
23
Challenges !
24
MAZE I
25
Tips – MAZE I When there is wall in front and at the left of the mBot, right turn should be performed, vice versa. To avoid crashing wall when moving forward, something should be added in to the program.
26
Tips – Mechanics to avoid crashing
27
MAZE II
28
MAZE III
29
Tips – MAZE III Involve T-shaped intersection.
30
MAZE IV
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.