Grade 10 · Connected devices

One LED, three messages

Turn your working LED into a clear status indicator. Build three signals, test whether a partner can recognize them, and improve one using evidence.

For this lesson

5 pages · Use the handout for the complete instructions, examples and response spaces.

Signal studio1 light · 3 messages

Read the code. Watch the light.

Choose a starting pattern. Play it to see the code and light together, or use Step to pause at each delay. Use these examples or adapt them into your own three messages.

STATUS INDICATOROFF

Stopped. Choose a message, then press Play.

Delay timer—

The LED keeps its last state during delay(). It does not turn off just because the program is waiting.

Follow the instructions

Stopped
  1. void showReady() {
  2. ledOn();
  3. delay(1000);
  4. ledOff();
  5. }
Back in loop(), between messages
showReady();call the function
delay(3000);then wait in darkness

Start with the function call in loop(). The program runs the named function, then returns to the next line.

On/off instruction just ranWaiting here

ledOn() and ledOff() represent your own working LED commands. The scaffold below explains how to fill them.

Ready · timing guideEach block is proportional to its duration.
  1. 1ON · 1000 ms
  2. 2OFF · 3000 ms · between messages

1000 milliseconds (ms) = 1 second. The short flashes here last 250 ms: one quarter of a second.

Your design challenge

One light. A clear message.

A device has one light and no screen. Choose a device and its user, then design signals for ready, working and needs attention. These are imagined device states: your program chooses which message to display; it is not sensing the device or connecting to the internet.

Your code works—but does your user understand it?
Today’s route

Build → test → improve

55 minutes
  1. 01
    0–5 min

    Start with what works

    Run your last working blink and save a backup. Keep the same working circuit and settings.

  2. 02
    5–10 min

    Choose your device and user

    Choose a device such as a classroom printer, charging station or desk assistant. Explain who uses it and why they need the three messages.

  3. 03
    10–17 min

    Plan your signal guide

    Plan ready, working and needs attention. Record each pattern, every on/off time in milliseconds, and why the patterns should be distinguishable. The examples are starting points you may use or adapt.

  4. 04
    17–30 min

    Build three named functions

    Put each pattern in showReady(), showWorking() or showAttention(). Call them from loop(). Test each pattern. Every signal ends with the light off; leave the same three-second dark gap between messages.

  5. 05
    30–34 min

    Prepare a fair test

    Teach a partner your signal guide and let them practise. Prepare a mixed sequence containing each message twice. Keep the guide visible, but hide the code and message order. Upload once and watch a practice round. Begin scored trial 1 immediately after the long ten-second dark pause at the end of that round.

  6. 06
    34–42 min

    Record six recognition trials

    For each trial, record the intended message, the partner’s answer and any confusion or hesitation. Do not coach them during the test. Count correct answers out of six; honest results matter more than a perfect score.

  7. 07
    42–49 min

    Revise and retest

    Use an observation to change one timing value or pattern feature. If all signals were clear, predict a useful improvement such as a shorter message. Explain the prediction, then run another six trials in a different mixed order. Record whether recognition was better, the same or worse.

  8. 08
    49–55 min

    Save and explain

    Save your final sketch, signal guide, both test records and explanation. Show a teacher your working signals, or record a short video. If sharing a board, keep your own code and evidence.

A small new coding idea

Give each message a name

A function lets you name a set of instructions, then ask the program to run it. You already have working instructions to turn your LED on and off. Today you will group them into messages.

Define it oncevoid showReady() {
  // Instructions for the ready signal
}

The definition says what happens.

Call it when neededshowReady();

The call runs those instructions, then continues with the next line.

New to these code words? Read the quick guide.
Function
A named group of instructions. Writing void showReady() { ... } defines what the function does. Writing showReady(); calls it: the program runs those instructions, then returns to the next line.
void
This function performs instructions without returning a value.
Braces and semicolons
The braces { } contain a function’s instructions. A function call such as showReady(); ends with a semicolon. Put new functions outside setup() and loop(), not inside their braces.
delay
delay(1000); pauses the program for 1000 milliseconds, which is one second. An on-delay controls how long the light stays lit; an off-delay controls darkness.
setup and loop
Keep your existing setup() and pin declarations. setup() runs once when the program starts. loop() runs repeatedly, so the six-message test round repeats.
Build from your working blink

Your starting code

Fill the two helpers before uploading

ledOn() and ledOff() below are empty. They cannot control your LED until you copy in the exact ON and OFF statements from your own working sketch. Keep your pin declarations and setup(). Replace your old loop(); do not add a second one.

  1. Keep the pin declarations and setup() from your successful blink sketch. Delete your old loop(), then paste the complete code block after the closing brace of setup().
  2. Copy your existing LED ON statement into ledOn() and your existing LED OFF statement into ledOff(). These empty helpers do nothing until you fill them. For example, copy digitalWrite(LED, HIGH); only if that is already your working ON instruction. Preserve your own pin name and on/off levels.
  3. Check that there is exactly one setup() and one loop(). Save, verify and upload. After watching a practice round, begin scored trial 1 immediately after the long ten-second dark pause.
  4. Adapt the signal timings to your design. For the second test, rearrange the six calls so each still appears twice. Keep five 3000 ms gaps and the final 10000 ms round-ending gap.
Arduino / ESP32 · C++
// Keep your existing pin declarations and setup() unchanged.
// Do not add a second setup() or a second loop().
// Add these two small helper functions OUTSIDE setup() and loop().
void ledOn() {
  // Paste the exact LED ON instruction from your working sketch here.
}
void ledOff() {
  // Paste the exact LED OFF instruction from your working sketch here.
}

// Each signal function ends with the light OFF.
void showReady() {
  ledOn();
  delay(1000);
  ledOff();
}

void showWorking() {
  ledOn(); delay(250);
  ledOff(); delay(250);
  ledOn(); delay(250);
  ledOff(); delay(250);
  ledOn(); delay(250);
  ledOff();
}

void showAttention() {
  ledOn(); delay(250);
  ledOff(); delay(250);
  ledOn(); delay(250);
  ledOff(); delay(250);
  ledOn(); delay(1000);
  ledOff();
}

// REPLACE your old loop() with this one.
// Each message occurs twice. Hide this order from your partner.
void loop() {
  showWorking(); delay(3000);
  showReady(); delay(3000);
  showAttention(); delay(3000);
  showReady(); delay(3000);
  showAttention(); delay(3000);
  showWorking(); delay(10000); // Longer darkness ends the test round.
}

Copy these functions into your working sketch. This scaffold is not a complete replacement sketch.

You may ask AI to help organize your existing working code into functions. Tell it to preserve the LED pin, board setup and on/off commands. Check the result yourself and be ready to explain one call and one delay.

Find out, then improve

Test the message, not their memory

6 trials + 6 trials

Guide visible

Teach your partner the signals and let them practise. Keep the signal guide where they can see it.

Order hidden

Use each message twice in a mixed order. Hide the code and sequence, and do not coach your partner.

Change, then retest

Revise one feature using an observation or prediction. Test six more messages in a different mixed order.

Make the rounds clear: after practising, wait for the ten-second dark gap. The next signal is trial 1. Leave three seconds of darkness between messages and ten seconds after the sixth message. That longer gap tells your partner the round has ended.

Record this for every trial

Trial numberIntended messagePartner’s answerConfusion or hesitation

Use the tables in your handout. Compare your correct answers out of six before and after the change. Honest results matter more than a perfect score.

Show what you can do

Your classroom score

8points

Each row earns 1 point when the evidence is shown, or 0 if it is not yet shown. Total: 8 points. This is a formative classroom task score, not an official MYP criterion level. Recognition results do not have to be 6 out of 6, and a revision does not have to improve the result to earn credit. Explain what actually happened.

  1. 1

    Purpose and signal guide

    Name a device and user; record all three messages with their patterns and timing values.

    1 point
  2. 2

    Three working signals

    Demonstrate three planned patterns, each with a different timing or flash sequence, on your working or shared setup. Leave an off gap between messages.

    1 point
  3. 3

    Organized code

    Use three named signal functions and call them from loop(). Scaffolding or AI help is allowed.

    1 point
  4. 4

    Explain the code

    Correctly explain one function call and one delay value in your own code, in writing or aloud.

    1 point
  5. 5

    First test record

    Record six intended messages, six partner answers and at least one specific observation. The guide is visible and the order hidden.

    1 point
  6. 6

    A justified revision

    Change one timing value or pattern feature and explain why the first test or a stated prediction supports that change.

    1 point
  7. 7

    Retest and compare

    Record another six trials in a different mixed order. Compare the two results honestly and explain what they suggest.

    1 point
  8. 8

    Complete evidence

    Save your final .ino code, guide, both test records and a demonstration or teacher check.

    1 point
Before you finish

Keep the evidence together

  • Final sketch folder including the .ino file
  • Signal guide with timings
  • Two six-trial test records and a justified revision
  • Teacher-witnessed demonstration or short video

Be ready to explain

“We changed ______ because ______. In the second test, ______. This suggests ______.”

Read the handout text online

For diagrams, visual examples and the full layout, open the handout above.

One LED three messages

Grade 10 Design | 23 September 2026 | 55 minutes | Task score out of 8

Turn your working LED into a clear status indicator. Build three signals, test whether a partner can recognize them, and improve one using evidence.

Name __________________________________ Class __________ Date ______________

Start with your working blink

Use your existing working ESP32, computer and LED setup. Keep the same wiring, LED pin, on/off commands and successful board settings. No extra components or new connections are needed.

Run your last working blink, save a backup, then work in a new sketch called G10_Three_Messages_Name. Keep any existing current-limiting resistor in your external LED circuit. If a setup stops working, ask your teacher and test your own code on a working shared setup.

Design a status indicator

A device has one light and no screen. Choose a device and its user, then design signals for ready, working and needs attention. These are imagined device states: your program chooses which message to display; it is not sensing the device or connecting to the internet.

My device and its user

________________________________________________________________________________

Why does this user need these messages?

________________________________________________________________________________

Plan your signal guide

Record the flashes and every on/off time. Use milliseconds: 1000 ms = 1 second. Make the patterns easy to tell apart. Each ends with the LED off.

MessageFlash pattern and on/off times in milliseconds
Ready
Working
Needs attention

Starting ideas: one long flash; three short flashes; two short flashes then one long flash. The scaffold uses 1000 ms for a long flash and 250 ms for a short flash and internal dark gap. You may adapt these.

Today: 0-5 min backup / 5-10 device and user / 10-17 plan / 17-30 code30-34 prepare test / 34-42 test / 42-49 revise and retest / 49-55 save

Build your signals with functions

A function gives a name to a group of instructions. You can then run that group by writing its name. You will use one function for each message so your program is easier to read and change.

Function. A named group of instructions. Writing void showReady() { ... } defines what the function does. Writing showReady(); calls it: the program runs those instructions, then returns to the next line.

void. This function performs instructions without returning a value.

Braces and semicolons. The braces { } contain a function’s instructions. A function call such as showReady(); ends with a semicolon. Put new functions outside setup() and loop(), not inside their braces.

delay. delay(1000); pauses the program for 1000 milliseconds, which is one second. An on-delay controls how long the light stays lit; an off-delay controls darkness.

setup and loop. Keep your existing setup() and pin declarations. setup() runs once when the program starts. loop() runs repeatedly, so the six-message test round repeats.

Use the scaffold on the next page

1. Keep the pin declarations and setup() from your successful blink sketch. Delete your old loop(), then paste the complete code block after the closing brace of setup().

2. Copy your existing LED ON statement into ledOn() and your existing LED OFF statement into ledOff(). These empty helpers do nothing until you fill them. For example, copy digitalWrite(LED, HIGH); only if that is already your working ON instruction. Preserve your own pin name and on/off levels.

3. Check that there is exactly one setup() and one loop(). Save, verify and upload. After watching a practice round, begin scored trial 1 immediately after the long ten-second dark pause.

4. Adapt the signal timings to your design. For the second test, rearrange the six calls so each still appears twice. Keep five 3000 ms gaps and the final 10000 ms round-ending gap.

The two helper functions ledOn() and ledOff() are small named groups too. Each contains your own working instruction. Their names let the signal functions use your hardware without guessing its pin or on/off levels.

Check your understanding

Choose one function call from your code. What happens when the program reaches it?

________________________________________________________________________________

________________________________________________________________________________

Choose one delay value. How many milliseconds is it, and is the light on or off?

________________________________________________________________________________

________________________________________________________________________________

You may ask AI to help organize your existing working code into functions. Tell it to preserve the LED pin, board setup and on/off commands. Check the result yourself and be ready to explain one call and one delay.

Signal scaffold reference

This is part of your existing sketch, not a complete replacement file. Keep your pin declarations and setup(). Delete the old loop(), paste this block, then fill both empty helpers.

// Keep your existing pin declarations and setup() unchanged.

// Do not add a second setup() or a second loop().

// Add these two small helper functions OUTSIDE setup() and loop().

void ledOn() {

// Paste the exact LED ON instruction from your working sketch here.

}

void ledOff() {

// Paste the exact LED OFF instruction from your working sketch here.

}

// Each signal function ends with the light OFF.

void showReady() {

ledOn();

delay(1000);

ledOff();

}

void showWorking() {

ledOn(); delay(250);

ledOff(); delay(250);

ledOn(); delay(250);

ledOff(); delay(250);

ledOn(); delay(250);

ledOff();

}

void showAttention() {

ledOn(); delay(250);

ledOff(); delay(250);

ledOn(); delay(250);

ledOff(); delay(250);

ledOn(); delay(1000);

ledOff();

}

// REPLACE your old loop() with this one.

// Each message occurs twice. Hide this order from your partner.

void loop() {

showWorking(); delay(3000);

showReady(); delay(3000);

showAttention(); delay(3000);

showReady(); delay(3000);

showAttention(); delay(3000);

showWorking(); delay(10000); // Longer darkness ends the test round.

}

The 3000 ms dark gaps separate messages. After the sixth message, 10000 ms of darkness ends the round. Then loop() repeats it. Practise once, then begin scored trial 1 immediately after the long dark pause.

Online lesson and copyable code: mistera.tech/curriculum/lessons/grade-10-one-led-three-messages/

Test the signals with a partner

Show your partner the guide and practise once. Keep the guide visible; hide the code and order. Each round has six messages in mixed order, each appearing twice. Start trial 1 after the long ten-second dark pause. Do not coach your partner. Write at least one specific observation.

Partner ______________________________ First test correct answers ______ / 6

TrialIntended messagePartner answerHesitation or confusion
1
2
3
4
5
6

Change one timing or pattern feature. What did you change, and why?

________________________________________________________________________________

________________________________________________________________________________

Use a first-test observation to justify the change. If all signals were clear, predict a useful improvement such as a shorter message, then test that prediction.

Retest in a different mixed order

Keep the guide visible and hide the new order. Each message still appears twice.

TrialIntended messagePartner answerHesitation or confusion
1
2
3
4
5
6

Retest correct answers ______ / 6. Recognition was: better / the same / worse.

What do the results suggest about your change?

________________________________________________________________________________

Show what you learned

In the final six minutes, save your final sketch, signal guide, both test records and explanation. Show a teacher the three working signals, or record a short video. If sharing a board, keep your own code and evidence.

Your task score out of 8

Each row earns 1 point when the evidence is shown, or 0 if it is not yet shown. Total: 8 points. This is a formative classroom task score, not an official MYP criterion level. Recognition results do not have to be 6 out of 6, and a revision does not have to improve the result to earn credit. Explain what actually happened.

What you showEvidence for one pointScore
Purpose and signal guideName a device and user; record all three messages with their patterns and timing values./ 1
Three working signalsDemonstrate three planned patterns, each with a different timing or flash sequence, on your working or shared setup. Leave an off gap between messages./ 1
Organized codeUse three named signal functions and call them from loop(). Scaffolding or AI help is allowed./ 1
Explain the codeCorrectly explain one function call and one delay value in your own code, in writing or aloud./ 1
First test recordRecord six intended messages, six partner answers and at least one specific observation. The guide is visible and the order hidden./ 1
A justified revisionChange one timing value or pattern feature and explain why the first test or a stated prediction supports that change./ 1
Retest and compareRecord another six trials in a different mixed order. Compare the two results honestly and explain what they suggest./ 1
Complete evidenceSave your final .ino code, guide, both test records and a demonstration or teacher check./ 1

Total ______ / 8

Save your final sketch folder including the .ino file, this guide and test record, and a demonstration or teacher check. There is no extra hardware task today.

One thing I can now explain or do independently

________________________________________________________________________________

________________________________________________________________________________

Teacher feedback or next step

________________________________________________________________________________

________________________________________________________________________________