{
 "format": "mbc-project",
 "target": "spike:pybricks",
 "specVersion": 2,
 "meta": {
  "name": "測距者8路 範例5 跟著手走",
  "author": "MBC Robot",
  "createdAt": "2026-10-20T00:00:00.000Z",
  "modifiedAt": "2026-10-20T00:00:00.000Z"
 },
 "board": {
  "fqbn": null,
  "displayName": "LEGO SPIKE Prime"
 },
 "workspace": {
  "blocks": {
   "languageVersion": 0,
   "blocks": [
    {
     "type": "arduino_setup",
     "next": {
      "block": {
       "type": "dev_mbc_laser8__config",
       "fields": {
        "PORT": "C"
       },
       "next": {
        "block": {
         "type": "spike_drivebase_config",
         "fields": {
          "LEFT": "E",
          "LDIR": "ccw",
          "RIGHT": "F",
          "RDIR": "cw",
          "WHEEL": 56,
          "AXLE": 112,
          "GYRO": "N"
         }
        }
       }
      }
     },
     "x": 40,
     "y": 90
    },
    {
     "type": "arduino_loop",
     "next": {
      "block": {
       "type": "controls_if",
       "extraState": {
        "elseIfCount": 2,
        "hasElse": true
       },
       "inputs": {
        "IF0": {
         "block": {
          "type": "compare_op",
          "fields": {
           "OP": "GT"
          },
          "inputs": {
           "A": {
            "block": {
             "type": "dev_mbc_laser8_min_distance",
             "fields": {
              "PORT": "C"
             }
            }
           },
           "B": {
            "shadow": {
             "type": "math_number",
             "fields": {
              "NUM": 60
             }
            }
           }
          }
         }
        },
        "DO0": {
         "block": {
          "type": "drive_stop",
          "fields": {
           "HOW": "brake"
          }
         }
        },
        "IF1": {
         "block": {
          "type": "compare_op",
          "fields": {
           "OP": "LT"
          },
          "inputs": {
           "A": {
            "block": {
             "type": "dev_mbc_laser8_min_distance",
             "fields": {
              "PORT": "C"
             }
            }
           },
           "B": {
            "shadow": {
             "type": "math_number",
             "fields": {
              "NUM": 15
             }
            }
           }
          }
         }
        },
        "DO1": {
         "block": {
          "type": "drive_drive",
          "inputs": {
           "S": {
            "shadow": {
             "type": "math_number",
             "fields": {
              "NUM": -80
             }
            }
           },
           "T": {
            "shadow": {
             "type": "math_number",
             "fields": {
              "NUM": 0
             }
            }
           }
          }
         }
        },
        "IF2": {
         "block": {
          "type": "compare_op",
          "fields": {
           "OP": "GT"
          },
          "inputs": {
           "A": {
            "block": {
             "type": "dev_mbc_laser8_min_distance",
             "fields": {
              "PORT": "C"
             }
            }
           },
           "B": {
            "shadow": {
             "type": "math_number",
             "fields": {
              "NUM": 25
             }
            }
           }
          }
         }
        },
        "DO2": {
         "block": {
          "type": "drive_drive",
          "inputs": {
           "S": {
            "shadow": {
             "type": "math_number",
             "fields": {
              "NUM": 100
             }
            }
           },
           "T": {
            "block": {
             "type": "math_op",
             "fields": {
              "OP": "MUL"
             },
             "inputs": {
              "A": {
               "block": {
                "type": "dev_mbc_laser8_min_direction",
                "fields": {
                 "PORT": "C"
                }
               }
              },
              "B": {
               "shadow": {
                "type": "math_number",
                "fields": {
                 "NUM": 15
                }
               }
              }
             }
            }
           }
          }
         }
        },
        "ELSE": {
         "block": {
          "type": "drive_stop",
          "fields": {
           "HOW": "brake"
          }
         }
        }
       },
       "next": {
        "block": {
         "type": "spike_wait_ms",
         "inputs": {
          "MS": {
           "shadow": {
            "type": "math_number",
            "fields": {
             "NUM": 50
            }
           }
          }
         }
        }
       }
      }
     },
     "x": 40,
     "y": 294
    }
   ]
  },
  "variables": []
 },
 "variables": [],
 "lastFlashedHash": null
}