---
id: "{{ID}}"
title: "{{TITLE}}"
type: "LAB"
created_by: "Curriculum OS Builder"
phase: "{{PHASE}}"
deliverable: "P3-T2"
version: "{{VERSION}}"
date: "{{DATE}}"
---
template_required_sections:
  - "🎯 Overview"
  - "🛠️ Environment & Setup"
  - "📝 Lab Tasks (3-Tier Differentiation)"
  - "🥉 Bronze (Foundational)"
  - "🥈 Silver (Application)"
  - "🥇 Gold (Enrichment/Creative)"
  - "🔍 Troubleshooting & Debugging"
  - "🏁 Submission & Check-off"
---

<!-- INJECT_BODY -->

# 👨‍💻 CODE LAB: [LAB TITLE]
_Unit: U[X] | Module: M[X.X] | Lesson: Lesson [XX]_

## 🎯 Overview
This lab focuses on the practical implementation of the technical concepts covered in the lesson. Students will transition from theory to code, focusing on building, debugging, and optimizing their logic.

## 🛠️ Environment & Setup
- **Language/Framework:** [e.g., Python 3.12, Arduino C++, Node-RED]
- **IDE/Editor:** [e.g., Thonny, Arduino IDE, VS Code]
- **Required Libraries:** [List libraries and version if applicable]
- **Hardware Connection:** [Optional - Brief description of circuit setup if hardware-dependent]

## 📝 Lab Tasks (3-Tier Differentiation)

### 🥉 Bronze (Foundational)

> **Duration:** {{ XX }} mins
**Objective:** Establish basic functionality.
- **Task:** [e.g., Create a basic script to read data from the DHT11 sensor.]
- **Requirement:** Code MUST be syntactically correct and run without errors.

### 🥈 Silver (Application)

> **Duration:** {{ XX }} mins
**Objective:** Add logic and data processing.
- **Task:** [e.g., Add a conditional statement to turn on an LED if the temperature exceeds 30°C.]
- **Requirement:** Demonstrate understanding of control flow and data comparison.

### 🥇 Gold (Enrichment/Creative)

> **Duration:** {{ XX }} mins
**Objective:** Optimize, extend, or integrate.
- **Task:** [e.g., Log the temperature data to a local CSV file with timestamps.]
- **Requirement:** Show advanced resource management (file I/O, timing, or external API integration).

## 💻 Technical Reference ([SME_MANDATE])
<!-- [SME_MANDATE] -->
> Any code provided in this section must be verified for syntax accuracy.

```python
# [SAMPLE CODE WRAPPER]
# Paste the core logic here for student reference.
```
<!-- [/SME_MANDATE] -->

## 🔍 Troubleshooting & Debugging
| Issue | Potential Cause | Solution |
| :--- | :--- | :--- |
| [e.g., "ImportError"] | Library not installed | Run `pip install [library]` |
| [e.g., "Serial Timeout"] | Wrong COM port | Check Device Manager and update port in script |

## 🏁 Submission & Check-off
- [ ] Code runs successfully on the target hardware/environment.
- [ ] Docstrings and comments are added in Vietnamese for clarity.
- [ ] Variables follow the naming convention defined in the Content Style Guide.
