Week 2 · Lesson 1 · 55 minutes

Choose the event that changes the state

Build and explain this stage of your own connected prototype.

Planned lesson. Follow your teacher’s teaching order.

Task steps and checks

Do the work

  1. Open your October design. Mark the user, four requirements and chosen signals. Check what your saved sketch and board actually do.
  2. Choose an action a person can take. A manual report is enough. Write three rules: current state, event, condition, next state and output of each LED. Use your own state meanings.
  3. Example: Unknown + desk helper reports free + valid report → Available → A steady, B off. The report is manual; it does not prove the desk is empty.
Follow the path
  1. User action
  2. Current state + condition
  3. Next state
  4. LED A + LED B

Check your result: Give a partner one starting state and event. They should be able to predict the new state and both lights from your table.

Revised weekly handout pages: 1, 2.

Materials

Existing October design, saved code, teacher-verified ESP32 circuit, USB data cable and computer; shared hardware, individual evidence.

Resources

Vocabulary

State transition
A rule linking the current state and an event to the next state and output.

Original classroom model

State plus a validated event

Multiple LEDs on breadboards are confirmed; three-state code and networking are not. Keep each student’s October signal meanings. This manual desk-report example is a model, not occupancy sensing.

Use the buttons to step through. With scripts off, every frame remains readable.

One explicit transition

One explicit transitionCurrent: unknownEvent: report 1Valid: 0 / 1 / 2Next: availableLED A steady
  1. Current: unknown
  2. Event: report 1
  3. Valid: 0 / 1 / 2
  4. Next: available
  5. LED A steady

The starter sets state to 1 and refreshes report time. The teacher must verify each LED and its own resistor; a diagram does not prove hardware works.

Read the diagram
  1. Current: unknown
  2. Event: report 1
  3. Valid: 0 / 1 / 2
  4. Next: available
  5. LED A steady

A report can expire

A report can expireReport age grows60 s demo limitState → unknownBoth double-flash
  1. Report age grows
  2. 60 s demo limit
  3. State → unknown
  4. Both double-flash

In the supplied starter, expiry applies to nonzero states after 60000 ms without a valid report. Justify a suitable timeout and meaning for your own user.

Read the diagram
  1. Report age grows
  2. 60 s demo limit
  3. State → unknown
  4. Both double-flash

What must the user know before relying on an available report?

Discuss before revealing

Who reported it, how old it is and what it means. A manual report can be wrong or stale. Define your own useful event, condition, next state and output.

See it

An event moves the system to a new stateCurrent stateNext statea valid eventany other event: no changeName the states and the event for your own design.The event is a real user action, not a line of code.
A state changes only when a valid event happens. Choose a real user action as your event, and decide what should happen when any other event arrives.

More examples and practice

Retrieve your saved version · 5 minutes

Open your own latest code and evidence. State what actually works and the next check; keep earlier versions.

Choose the event that changes the state · 10 minutes

Continue your October user, chosen solution and four requirements. The multi-LED breadboard from November 5 is the starting build, not evidence of finished state logic. Identify a real user action that should change its state; do not repeat A/B research.

A library-seat light is green because somebody selected available. Does it prove the seat is empty?

Reveal reasoning

No. It is a manual report. Label who reports what, when it becomes out of date, and what the user should do before relying on it.

Build test and record · 30 minutes

Work through the task below. Take turns with hardware; each student records their own actions, predictions and observations.

Practice

  1. Write current state / event / condition / next state / output for three useful transitions. A browser button is sufficient input; sensors and new purchases are optional.

Save and explain your evidence · 10 minutes

Save the version and results. Explain one decision and one limitation to a partner. Record unfinished work for the next lesson instead of claiming success.

Choose the event that changes the state / Program and trace your transitions

Do only the parts you did not finish in class. Write what really happened; if you did not test something, write NOT TESTED. This is one task for the week, and nothing else is due.

  1. Open this week’s handout and your saved code.
  2. Finish the evidence for both lessons. Use only your saved code and real results.

You are finished when: The evidence for both lessons is complete and matches what you really did.

Why this matters: Each week’s evidence becomes part of the connected prototype evidence you submit in Week 8.

  • There is no hardware task at home.

Revised weekly handout pages: 1, 2.

Weekly homework (Word) · Chinese weekly handout (Word)

Feedback on this week’s evidence

Task feedback only. Final C and D are separate best-fit judgements out of 8 using the school’s current MYP Year 5 criteria; do not average weekly bands.

This week’s task
Choose the event that changes the state / Program and trace your transitions
Personal evidence and explanation
Identify your own technical action, evidence file, actual outcome and limitation.
BandObservable evidence
0No assessable evidence for this task yet.
1–2Identifies parts of the task; personal work and results are difficult to follow.
3–4Completes some steps with support; evidence or explanations have gaps.
5–6Completes the task with traceable personal evidence and explains results and limitations.
7–8Works independently, uses precise evidence to justify decisions and checks the effect of changes.