Smart Technology

Form 3 - ECA

2024-2025

Floor 4 - Computer Room

Mr. Peter

Outline

Outline

Timer

1

Touch Timer

2

Tamagotchi

3

Let's learn Microbit

Basic Timer

Pressing A button to start the timer

1

Pressing B button to stop the timer

2

Showing timing if the timer started

3

Formula:

round(\ \frac{running\ time(ms)\ -\ start\ pressing\ time(ms))}{1000}\ )

Basic timer - Ex04_1

name it as 01_YourName_Ex04_1.hex

Download it

Touch timer

Touch timer - Ex04_2

Ex04_1 - Demo

Touch timer - Ex04_2

Check if A button is pressing inside forever block

1

Part 1 - detect pressing status

If A button is pressing, then show tick icon

2

if A button is not pressed and it is pressed before, then show cross button.

3

4

Check if A button is not pressed and it is pressed before

Touch timer - Ex04_2

name it as 01_YourName_Ex04_2.hex

Download it

Touch timer - Ex04_3

Ex04_2 - Demo

Touch timer - Ex04_3

Check if A button is pressed and it is not pressed before, then storing the timing in a variable

1

Finish touch timer

if A button is not pressed and it is pressed before, then show how many seconds the user has pressed it.

2

Formula:

round(\ \frac{running\ time(ms)\ -\ start\ pressing\ time(ms))}{1000}\ )

Touch timer - Ex04_3

name it as 01_YourName_Ex04_3.hex

Download it

Tamagotchi

Press A to play with your pet

1

Play with your e-pet

Shake it to feed your pet

2

if your pet has been ignored for over 10 seconds, then your pet will yawn.

3

4

if your pet has been ignored for 5 seconds, then your pet will be so sad.

Tamagotchi - Ex04_4

If your pet is not fed for more than 20 seconds, your pet will die.

5

Tamagotchi - Ex04_4

name it as 01_YourName_Ex04_4.hex

Download it