Smart Technology
Form 3 - ECA
2024-2025
Floor 4 - Computer Room
Mr. Peter
Outline
Outline
What is going to learn in the second term

1
What is Microbit?
2
What Microbit can do?
3
Funny Programming
4
Interesting Technology
5
What is going to learn in this course
What we will learn


Microcontroller
Learning Outcome




A lot of projects
Funny Programming

Funny Programming
Block-based programming rather than Text-based programming
Interesting Technology

Machine Learning
Interesting Technology
Design neural network

Let's learn Microbit

Let's learn Microbit

Change language
Let's learn Microbit
Start a new project and name as 99_YourName_Ex01_1

Let's learn Microbit
Start a new project and name it as 99_YourName_Ex01_1

Ex01_1 - fireworks

Ex01_1 - fireworks
name it as 01_YourName_Ex01_1.hex

Download it
Ex01_2 - Introduction to Variable
Variable is similar to a box

To declare a variable, we need to define a name for it

PeterBox
Ex01_2 - Introduction to Variable
Variable can store number

PeterBox
1024
Ex01_2 - Introduction to Variable

PeterBox
Variable can store number or text
Ex01_2 - Introduction to Variable
Variable can store number or text

PeterBox
"Hello"
Ex01_2 - Introduction to Variable

To declare a variable, we can click the "Make a Variable" button
Ex01_2 - Introduction to Variable
Define a meaningful name for the variable

Ex01_2 - Introduction to Variable

Directly change the value inside the varaible
Increase the value inside the variable
Ex01_2 - Introduction to Variable

Ex01_2 - Increasing and Decreasing
name it as 01_YourName_Ex01_2.hex

Download it
Ex01_2 - Increasing and Decreasing
Add a variable, and name it "num"
1
Display number in LEDs gradually from 1 to 9
Set the "num" variable equal to 1 inside "on start" code block
2
Update the "num" variable and change it by 1 inside the "forever" code block
3
Show the number using "show number" code block
4

Use "if then" code block to check if the "num" is equal to 10, then set it as 0
5
Ex01_3 - Increasing and Loop
name it as 01_YourName_Ex01_3.hex

Download it
Ex01_3 - Increasing and Loop
Increase variable value if microbit is shaked
Ex01_4 - Shake the number
name it as 01_YourName_Ex01_4.hex

Download it
Ex01_4 - Shake the number
Add shake event
1
If a shake event is triggered, the LED displays the opposite icon


Add a variable which stores a state number 0 or 1, 0 represents the tick icon and 1 represents the cross icon
2
In the shake event, use the if block to determine if it is in that state and display the corresponding icon
3
Ex01_5 - Shake and reversal
name it as 01_YourName_Ex01_5.hex

Download it
Ex01_6 - Shake and reversal
Smart Technology - Lesson01
By Mr Peter
Smart Technology - Lesson01
- 245