Skip to content

Teaching methods that work for embedded programming

  1. Sequence the activities around one example file through PRIMM
  2. Design practice files with fading support, and turn one into a Parsons problem
  3. Split work between the emulator and a real board
  4. Explain the research behind these methods
  • From the previous lesson, what kind of attribution text must go on every slide?
  • In your course, at what minute of the first hour do learners see their first piece of working code?

Open Explorer’s lessons First program and Read a sensor and notice three things.

  • The “See it work first” section always says predict before you run
  • The “Worked example” section is labelled Move 1, 2, 3
  • The first lesson’s practice file has 2 blanks; the next lesson’s has 4

None of these three happened by accident. Each one has research behind it.

1. PRIMM: Predict, Run, Investigate, Modify, Make

Section titled “1. PRIMM: Predict, Run, Investigate, Modify, Make”

PRIMM (Predict, Run, Investigate, Modify, Make) sequences activity around example code into five stages: learners predict the result before running, run it to compare, investigate what each part does, modify the existing code, and then make something new. Research by Sentance, Waite and Kallia reports results from using PRIMM in schools, where the group taught with PRIMM outperformed the control group (Sentance, Waite & Kallia 2019). This fits the “start from something that works, then take it apart” principle that courses in TESA Open Knowledge use.

Examples labelled with subgoals, such as “Move 1: pick a light” and “Move 2: start from a known state”, help beginners learn programming problem-solving better (Morrison, Margulieux & Guzdial 2015). Every worked example in the repository therefore always carries Move labels.

Start with a full example, then leave more and more blank until the learner writes the whole file themselves in the final task (backward fading) (Renkl & Atkinson 2003; Renkl, Atkinson & Große 2004). Another reason is expertise reversal: too much support becomes a burden once the learner has gotten better (Kalyuga, Ayres, Chandler & Sweller 2003). The practice used in this repository: within one module, practice files go from a full example → about 2 blanks → about 6 blanks → a blank file in the capstone task.

A Parsons problem gives learners lines of code to arrange in the right order. Research reports learning outcomes close to writing or fixing the code oneself, but in less time (Ericson, Margulieux & Rick 2017). This fits learners who do not yet have a board, and C-language lessons that have no emulator. In quiz.yaml, type: order builds a Parsons problem directly.

Practice testing and distributed practice are the two techniques with the highest utility scores in a review of ten learning techniques (Dunlosky et al. 2013). This is why every lesson has 3–5 check-for-understanding questions, and the “Before you start” section always asks a question that reviews the previous lesson.

6. The emulator for concepts, a real board for debugging and measurement

Section titled “6. The emulator for concepts, a real board for debugging and measurement”

A review of virtual and remote labs against hands-on labs found that most studies report equal or better outcomes (Brinson 2015). But some skills, such as debugging hardware, using measurement instruments, and dealing with real timing, must happen on a board. The split used in this repository is

Use the emulator Use a real board
Understanding concepts and the API Debugging when the board’s result differs from the emulator
Filling in practice files and iterating quickly Measuring real values with instruments
Designing the screen Real networking, power, and timing
Learners who do not yet have a board turn End-of-module labs and the capstone

7. Learn in a cohort; do not leave it purely self-paced

Section titled “7. Learn in a cohort; do not leave it purely self-paced”

As seen in the first lesson of this kit, pure self-paced study has a low completion rate. Mastery learning genuinely helps overall achievement (Kulik, Kulik & Bangert-Drowns 1990), but the same work also notes that fully self-paced programmes tend to have lower completion rates. So use a per-lesson passing bar (80%) together with cohort learning that has deadlines.

Use Explorer’s example 02_blink.py, sequenced through PRIMM.

  • Move 1: Predict (3 minutes) Have learners read only the values ROUNDS, ON_MS, OFF_MS and write a prediction
  • Move 2: Run (3 minutes) Run it in the emulator, compare with the prediction
  • Move 3: Investigate (8 minutes) Ask “what would happen if the last led.off() were removed?”, “why does it need str()?”
  • Move 4: Modify (8 minutes) Change the rhythm to a short-on, long-off pattern
  • Move 5: Make (15 minutes) Write a Morse-code blink of their own, on a board if one is available

Choose one module in your own course and plan three practice files.

File Support How many blanks Has a Parsons version?
Lesson 1 Full example, change one value 0–1
Lesson 2 About 2
Lesson 3 About 6

Then write one Parsons problem in quiz.yaml form (type: order) from the lesson 2 file.

Answer the questions in quiz.yaml. A score of 80% or more passes.

Further reading for instructors: Carpentries Instructor Training has a section on live coding and on giving feedback, which works well for lab classes.

Which method in this lesson were you already using without a name for it, and which one could you try as early as next week?

Review questions

Answer on your own first, then open the answer.

  1. Put the PRIMM stages in order. (Objective 1)

    1. Modify แก้โค้ดเดิม
    2. Predict ทำนายผล
    3. Make สร้างของใหม่
    4. Run รันเทียบกับคำทำนาย
    5. Investigate สืบว่าแต่ละส่วนทำอะไร
    Show answer

    Correct order: B. Predict ทำนายผล → D. Run รันเทียบกับคำทำนาย → E. Investigate สืบว่าแต่ละส่วนทำอะไร → A. Modify แก้โค้ดเดิม → C. Make สร้างของใหม่

    Predict, Run, Investigate, Modify, Make ทำนายก่อนทำให้ผู้เรียนอ่านโค้ดอย่างตั้งใจ และสร้างของใหม่เป็นขั้นสุดท้าย

  2. Which matches the fading principle within one module? (Objective 2)

    1. ทุกไฟล์ฝึกมีโค้ดให้ราว 70% เท่ากันตลอด
    2. ตัวอย่างเต็ม แล้วราว 2 ช่องว่าง แล้วราว 6 ช่องว่าง จนเป็นไฟล์เปล่าในงานปลายทาง
    3. เริ่มจากไฟล์เปล่าแล้วค่อยให้ตัวอย่างเต็มตอนท้าย
    4. ไม่ต้องมีไฟล์ฝึก ให้ดูเฉลยอย่างเดียว
    Show answer

    Answer: B. ตัวอย่างเต็ม แล้วราว 2 ช่องว่าง แล้วราว 6 ช่องว่าง จนเป็นไฟล์เปล่าในงานปลายทาง

    ตัวช่วยควรลดลงเมื่อผู้เรียนเก่งขึ้น ตัวช่วยที่มากเท่าเดิมตลอดจะกลายเป็นภาระ (expertise reversal)

  3. In this repository's quiz.yaml, which item type builds a Parsons problem? (Objective 2)

    1. type: single
    2. type: multi
    3. type: order
    4. type: short
    Show answer

    Answer: C. type: order

    type order ให้เรียงรายการตามลำดับ ใช้กับบรรทัดโค้ดได้โดยตรง

  4. Which activities belong on a real board? (choose all that apply) (Objective 3)

    1. วัดแรงดันจริงด้วยมัลติมิเตอร์
    2. ดีบักเมื่อผลบนบอร์ดต่างจากอีมูเลเตอร์
    3. ทำความเข้าใจว่า ui.Label รับอาร์กิวเมนต์อะไร
    4. ทดสอบการเชื่อมต่อเครือข่ายจริงและพลังงาน
    Show answer

    Answer: A. วัดแรงดันจริงด้วยมัลติมิเตอร์ · B. ดีบักเมื่อผลบนบอร์ดต่างจากอีมูเลเตอร์ · D. ทดสอบการเชื่อมต่อเครือข่ายจริงและพลังงาน

    การทำความเข้าใจ API ทำในอีมูเลเตอร์ได้ ส่วนการวัด การดีบักฮาร์ดแวร์ เครือข่ายจริง และพลังงานต้องใช้บอร์ด

  5. Which techniques did Dunlosky et al. (2013) rate as high utility? (Objective 4)

    1. การขีดเส้นใต้และการอ่านซ้ำ
    2. การฝึกตอบคำถามและการเว้นระยะทบทวน
    3. การสรุปย่อและการจินตนาการภาพ
    4. การฟังบรรยายยาวต่อเนื่อง
    Show answer

    Answer: B. การฝึกตอบคำถามและการเว้นระยะทบทวน

    practice testing และ distributed practice ได้คะแนนประโยชน์สูงสุด จึงให้ทุกบทมีเช็กความเข้าใจและคำถามทวนบทก่อน

  6. What trend did Brinson's (2015) review of virtual and remote labs report? (Objective 4)

    1. แล็บเสมือนแย่กว่าแล็บลงมือจริงเสมอ
    2. งานวิจัยส่วนใหญ่รายงานผลสัมฤทธิ์เท่ากันหรือดีกว่าแล็บลงมือจริง
    3. ไม่มีงานวิจัยเรื่องนี้
    4. ควรเลิกใช้บอร์ดจริงทั้งหมด
    Show answer

    Answer: B. งานวิจัยส่วนใหญ่รายงานผลสัมฤทธิ์เท่ากันหรือดีกว่าแล็บลงมือจริง

    ผลส่วนใหญ่เท่ากันหรือดีกว่า แต่ทักษะอย่างการวัดและการดีบักฮาร์ดแวร์ยังต้องใช้บอร์ดจริง จึงใช้แบบผสม

Cite this lesson

If you teach from this lesson or reuse it in slides or documents, credit it with the text below. If you changed it, add (adapted) after the title.

"Teaching methods that work for embedded programming" from TESA Open Knowledge by the Thai Embedded Systems Association (TESA), https://github.com/tesaiot/tesa-qualification-program, licensed under CC BY-NC 4.0

Thai attribution: "วิธีสอนที่ได้ผลกับการเขียนโปรแกรมระบบฝังตัว" จาก TESA Open Knowledge โดยสมาคมสมองกลฝังตัวไทย (Thai Embedded Systems Association: TESA) https://github.com/tesaiot/tesa-qualification-program สัญญาอนุญาต CC BY-NC 4.0

Lesson link: https://tesaiot.github.io/tesa-qualification-program/en/courses/educator-kit/m02-teach-and-assess/l01-teaching-methods/

Full guide: how to cite TESA

TESA Open Knowledge · © 2026 สมาคมสมองกลฝังตัวไทย (TESA) · CC BY-NC 4.0

Content is licensed CC BY-NC 4.0. Reuse it non-commercially and credit the Thai Embedded Systems Association (TESA) every time. · How to cite TESA