{
 "原理:微控制器如何一圈一圈地感測、決策、動作#1": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   0,
   3,
   3
  ],
  "nodes": [
   {
    "label": "眼睛看路",
    "sub": "感測",
    "color": 0
   },
   {
    "label": "大腦判斷",
    "sub": "決策",
    "color": 1
   },
   {
    "label": "手轉龍頭",
    "sub": "動作",
    "color": 2
   }
  ]
 },
 "原理:微控制器如何一圈一圈地感測、決策、動作#2": {
  "type": "flow",
  "layout": "cycle",
  "reveal": [
   0,
   3
  ],
  "nodes": [
   {
    "label": "感測",
    "sub": "感測器",
    "color": 0
   },
   {
    "label": "決策",
    "sub": "微控制器",
    "color": 1
   },
   {
    "label": "動作",
    "sub": "馬達",
    "color": 2
   }
  ],
  "edges": [
   [
    0,
    1
   ],
   [
    1,
    2
   ],
   [
    2,
    0,
    "回授"
   ]
  ]
 },
 "原理:微控制器如何一圈一圈地感測、決策、動作#3": {
  "type": "table",
  "head": [
   "部件",
   "功能"
  ],
  "widths": [
   1,
   2.6
  ],
  "reveal": [
   0,
   3,
   7,
   7
  ],
  "rows": [
   [
    "CPU",
    "一次執行一條指令"
   ],
   [
    "Flash",
    "存程式,斷電不消失"
   ],
   [
    "SRAM",
    "存變數,斷電就清空"
   ],
   [
    "計時器",
    "讓 millis 與 PWM 運作"
   ],
   [
    "GPIO",
    "腳位輸出高/低電位"
   ],
   [
    "ADC",
    "類比電壓轉成數字"
   ],
   [
    "UART、I²C、SPI",
    "與其他晶片溝通"
   ]
  ]
 },
 "原理:微控制器如何一圈一圈地感測、決策、動作#5": {
  "type": "bar",
  "unit": " ms",
  "labels": [
   "讀感測器",
   "運算",
   "寫馬達",
   "一圈合計"
  ],
  "values": [
   6,
   3,
   2,
   11
  ],
  "highlight": 3,
  "reveal": [
   0,
   0,
   4
  ]
 },
 "原理:微控制器如何一圈一圈地感測、決策、動作#7": {
  "type": "flow",
  "layout": "snake",
  "reveal": [
   0,
   3,
   5,
   5,
   5
  ],
  "nodes": [
   {
    "label": "原本一圈",
    "sub": "11 ms",
    "color": 0
   },
   {
    "label": "加上 delay",
    "sub": "+100 ms",
    "color": 4
   },
   {
    "label": "現在一圈",
    "sub": "111 ms",
    "color": 2
   },
   {
    "label": "× 車速",
    "sub": "40 cm/s",
    "color": 3
   },
   {
    "label": "盲目前進",
    "sub": "≈ 4.4 cm",
    "color": 4,
    "kind": "end"
   }
  ]
 },
 "機器人是由哪些部分組成的?#1": {
  "type": "flow",
  "layout": "snake",
  "reveal": [
   0,
   5,
   5
  ],
  "nodes": [
   {
    "label": "電源",
    "sub": "電池",
    "color": 2
   },
   {
    "label": "大腦",
    "sub": "微控制器",
    "color": 0
   },
   {
    "label": "感測器",
    "sub": "超音波、循線、IMU",
    "color": 1
   },
   {
    "label": "致動器",
    "sub": "直流馬達",
    "color": 4
   },
   {
    "label": "機構",
    "sub": "底盤與輪子",
    "color": 3
   }
  ]
 },
 "機器人是由哪些部分組成的?#2": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   0,
   4
  ],
  "nodes": [
   {
    "label": "電池",
    "sub": "經開關、保險絲供電",
    "color": 2
   },
   {
    "label": "微控制器",
    "sub": "讀取感測器資料",
    "color": 0
   },
   {
    "label": "馬達驅動模組",
    "sub": "控制左右馬達",
    "color": 3
   },
   {
    "label": "左右馬達",
    "color": 4
   }
  ]
 },
 "機器人是由哪些部分組成的?#3": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "cards": [
   {
    "title": "電源",
    "points": [
     "電池提供能量",
     "馬達與邏輯電源最好分開"
    ]
   },
   {
    "title": "大腦",
    "points": [
     "微控制器,不跑 Linux",
     "反應快、耗電低、價格便宜"
    ]
   },
   {
    "title": "感測器",
    "points": [
     "超音波測距、紅外線循線",
     "IMU 量轉動與加速度"
    ]
   }
  ]
 },
 "機器人是由哪些部分組成的?#4": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2
  ],
  "cards": [
   {
    "title": "致動器",
    "points": [
     "直流馬達讓輪子轉動",
     "腳位電流太小,要有馬達驅動模組"
    ]
   },
   {
    "title": "機構",
    "points": [
     "底盤、輪子",
     "減速齒輪、萬向輪"
    ]
   }
  ]
 },
 "機器人是由哪些部分組成的?#5": {
  "type": "flow",
  "layout": "cycle",
  "reveal": [
   0,
   1,
   4,
   4
  ],
  "nodes": [
   {
    "label": "讀取距離",
    "sub": "感測",
    "color": 0
   },
   {
    "label": "d < 20 cm?",
    "sub": "決策",
    "color": 2,
    "kind": "decision"
   },
   {
    "label": "停止或前進",
    "sub": "動作",
    "color": 1
   },
   {
    "label": "等 50 ms",
    "color": 3
   }
  ],
  "edges": [
   [
    0,
    1
   ],
   [
    1,
    2
   ],
   [
    2,
    3
   ],
   [
    3,
    0
   ]
  ]
 },
 "Arduino 與 ESP32 的差異與選擇#2": {
  "type": "cards",
  "reveal": [
   0,
   2
  ],
  "cards": [
   {
    "title": "Arduino Uno",
    "points": [
     "AVR 微控制器",
     "邏輯電壓 5 V",
     "沒有內建無線"
    ]
   },
   {
    "title": "ESP32",
    "points": [
     "邏輯電壓 3.3 V",
     "類比輸入 12 位元",
     "內建 Wi-Fi 與藍牙"
    ]
   }
  ]
 },
 "Arduino 與 ESP32 的差異與選擇#3": {
  "type": "table",
  "head": [
   "差異",
   "Uno",
   "ESP32"
  ],
  "widths": [
   1,
   1.6,
   1.6
  ],
  "reveal": [
   0,
   1,
   2,
   3,
   3,
   4
  ],
  "rows": [
   [
    "邏輯電壓",
    "5 V",
    "3.3 V,不耐 5 V"
   ],
   [
    "analogRead",
    "0~1023",
    "0~4095"
   ],
   [
    "PWM",
    "特定腳位 0~255",
    "LEDC,幾乎任何腳"
   ],
   [
    "無線",
    "無,需外接",
    "內建 Wi-Fi、藍牙"
   ]
  ]
 },
 "Arduino 與 ESP32 的差異與選擇#4": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2
  ],
  "cards": [
   {
    "title": "腳位限制",
    "points": [
     "有些僅能輸入",
     "有些影響開機",
     "有些被快閃記憶體占用"
    ]
   },
   {
    "title": "ADC2 與 Wi-Fi",
    "points": [
     "Wi-Fi 啟用時 ADC2 可能無法用",
     "類比感測器盡量接 ADC1"
    ]
   }
  ]
 },
 "Arduino 與 ESP32 的差異與選擇#5": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2,
   2
  ],
  "cards": [
   {
    "title": "Uno / Nano",
    "points": [
     "學基礎、電路簡單",
     "5 V 感測器與模組多",
     "出錯成本低"
    ]
   },
   {
    "title": "ESP32",
    "points": [
     "無線控制",
     "接相機模組",
     "連雲端"
    ]
   }
  ]
 },
 "Arduino 與 ESP32 的差異與選擇#6": {
  "type": "cards",
  "reveal": [
   0,
   2,
   2
  ],
  "cards": [
   {
    "title": "開發板 board",
    "points": [
     "晶片、USB 轉序列晶片、穩壓、排針做在一起",
     "插上 USB 就能燒錄"
    ]
   },
   {
    "title": "微控制器",
    "points": [
     "板子上那顆晶片本身"
    ]
   }
  ]
 },
 "零件清單與開發環境準備#1": {
  "type": "table",
  "head": [
   "類別",
   "內容"
  ],
  "widths": [
   1,
   2.6
  ],
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ],
  "rows": [
   [
    "開發板",
    "Uno/Nano 類一片、ESP32 一片"
   ],
   [
    "馬達驅動模組",
    "L298N 或 TB6612 類"
   ],
   [
    "輪式差速底盤",
    "兩顆減速馬達、兩輪、萬向輪"
   ],
   [
    "感測器",
    "超音波、三路循線、IMU"
   ]
  ]
 },
 "零件清單與開發環境準備#5": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ],
  "nodes": [
   {
    "label": "安裝 IDE",
    "sub": "Arduino IDE",
    "color": 0
   },
   {
    "label": "選擇開發板",
    "sub": "ESP32 需加核心",
    "color": 1
   },
   {
    "label": "選擇序列埠",
    "sub": "COM 或 /dev/ttyUSB*",
    "color": 2
   },
   {
    "label": "上傳 Blink",
    "sub": "板載 LED 閃爍",
    "color": 3,
    "kind": "end"
   }
  ]
 }
}
