Teaching methods that work for embedded programming
Objectives
Section titled “Objectives”- Sequence the activities around one example file through PRIMM
- Design practice files with fading support, and turn one into a Parsons problem
- Split work between the emulator and a real board
- Explain the research behind these methods
Before you start
Section titled “Before you start”- 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?
See it work first
Section titled “See it work first”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.
Concepts
Section titled “Concepts”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.
2. Subgoal-labelled examples
Section titled “2. Subgoal-labelled examples”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.
3. Scaffolding must fade
Section titled “3. Scaffolding must fade”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.
4. Parsons problems
Section titled “4. Parsons problems”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.
5. Spaced retrieval practice
Section titled “5. Spaced retrieval practice”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.
Worked example
Section titled “Worked example”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_MSand 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 needstr()?” - 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
Practice
Section titled “Practice”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.
Check your understanding
Section titled “Check your understanding”Answer the questions in quiz.yaml. A score of 80% or more passes.
Going further
Section titled “Going further”Further reading for instructors: Carpentries Instructor Training has a section on live coding and on giving feedback, which works well for lab classes.
Reflect
Section titled “Reflect”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.
-
Put the PRIMM stages in order. (Objective 1)
- Modify แก้โค้ดเดิม
- Predict ทำนายผล
- Make สร้างของใหม่
- Run รันเทียบกับคำทำนาย
- Investigate สืบว่าแต่ละส่วนทำอะไร
Show answer
Correct order: B. Predict ทำนายผล → D. Run รันเทียบกับคำทำนาย → E. Investigate สืบว่าแต่ละส่วนทำอะไร → A. Modify แก้โค้ดเดิม → C. Make สร้างของใหม่
Predict, Run, Investigate, Modify, Make ทำนายก่อนทำให้ผู้เรียนอ่านโค้ดอย่างตั้งใจ และสร้างของใหม่เป็นขั้นสุดท้าย
-
Which matches the fading principle within one module? (Objective 2)
- ทุกไฟล์ฝึกมีโค้ดให้ราว 70% เท่ากันตลอด
- ตัวอย่างเต็ม แล้วราว 2 ช่องว่าง แล้วราว 6 ช่องว่าง จนเป็นไฟล์เปล่าในงานปลายทาง
- เริ่มจากไฟล์เปล่าแล้วค่อยให้ตัวอย่างเต็มตอนท้าย
- ไม่ต้องมีไฟล์ฝึก ให้ดูเฉลยอย่างเดียว
Show answer
Answer: B. ตัวอย่างเต็ม แล้วราว 2 ช่องว่าง แล้วราว 6 ช่องว่าง จนเป็นไฟล์เปล่าในงานปลายทาง
ตัวช่วยควรลดลงเมื่อผู้เรียนเก่งขึ้น ตัวช่วยที่มากเท่าเดิมตลอดจะกลายเป็นภาระ (expertise reversal)
-
In this repository's quiz.yaml, which item type builds a Parsons problem? (Objective 2)
- type: single
- type: multi
- type: order
- type: short
Show answer
Answer: C. type: order
type order ให้เรียงรายการตามลำดับ ใช้กับบรรทัดโค้ดได้โดยตรง
-
Which activities belong on a real board? (choose all that apply) (Objective 3)
- วัดแรงดันจริงด้วยมัลติมิเตอร์
- ดีบักเมื่อผลบนบอร์ดต่างจากอีมูเลเตอร์
- ทำความเข้าใจว่า ui.Label รับอาร์กิวเมนต์อะไร
- ทดสอบการเชื่อมต่อเครือข่ายจริงและพลังงาน
Show answer
Answer: A. วัดแรงดันจริงด้วยมัลติมิเตอร์ · B. ดีบักเมื่อผลบนบอร์ดต่างจากอีมูเลเตอร์ · D. ทดสอบการเชื่อมต่อเครือข่ายจริงและพลังงาน
การทำความเข้าใจ API ทำในอีมูเลเตอร์ได้ ส่วนการวัด การดีบักฮาร์ดแวร์ เครือข่ายจริง และพลังงานต้องใช้บอร์ด
-
Which techniques did Dunlosky et al. (2013) rate as high utility? (Objective 4)
- การขีดเส้นใต้และการอ่านซ้ำ
- การฝึกตอบคำถามและการเว้นระยะทบทวน
- การสรุปย่อและการจินตนาการภาพ
- การฟังบรรยายยาวต่อเนื่อง
Show answer
Answer: B. การฝึกตอบคำถามและการเว้นระยะทบทวน
practice testing และ distributed practice ได้คะแนนประโยชน์สูงสุด จึงให้ทุกบทมีเช็กความเข้าใจและคำถามทวนบทก่อน
-
What trend did Brinson's (2015) review of virtual and remote labs report? (Objective 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
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