{
 "format": "mbc-project",
 "target": "spike:pybricks",
 "specVersion": 2,
 "meta": {
  "name": "神攝手WRO 範例3 數有幾格有顏色",
  "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_hue12__config",
       "fields": {
        "PORT": "C"
       }
      }
     },
     "x": 40,
     "y": 90
    },
    {
     "type": "arduino_loop",
     "next": {
      "block": {
       "type": "variables_set",
       "fields": {
        "VAR": {
         "id": "v_BwgzQTBfwr"
        }
       },
       "inputs": {
        "VALUE": {
         "shadow": {
          "type": "math_number",
          "fields": {
           "NUM": 0
          }
         }
        }
       },
       "next": {
        "block": {
         "type": "variables_set",
         "fields": {
          "VAR": {
           "id": "v_NK8TwtA9Rb"
          }
         },
         "inputs": {
          "VALUE": {
           "shadow": {
            "type": "math_number",
            "fields": {
             "NUM": 1
            }
           }
          }
         },
         "next": {
          "block": {
           "type": "ctrl_repeat",
           "inputs": {
            "TIMES": {
             "shadow": {
              "type": "math_number",
              "fields": {
               "NUM": 12
              }
             }
            },
            "DO": {
             "block": {
              "type": "controls_if",
              "inputs": {
               "IF0": {
                "block": {
                 "type": "compare_op",
                 "fields": {
                  "OP": "LT"
                 },
                 "inputs": {
                  "A": {
                   "block": {
                    "type": "dev_mbc_hue12_slot_hue",
                    "fields": {
                     "PORT": "C"
                    },
                    "inputs": {
                     "ARG_s": {
                      "block": {
                       "type": "variables_get",
                       "fields": {
                        "VAR": {
                         "id": "v_NK8TwtA9Rb"
                        }
                       }
                      }
                     }
                    }
                   }
                  },
                  "B": {
                   "shadow": {
                    "type": "math_number",
                    "fields": {
                     "NUM": 240
                    }
                   }
                  }
                 }
                }
               },
               "DO0": {
                "block": {
                 "type": "math_change",
                 "fields": {
                  "VAR": {
                   "id": "v_BwgzQTBfwr"
                  }
                 },
                 "inputs": {
                  "DELTA": {
                   "shadow": {
                    "type": "math_number",
                    "fields": {
                     "NUM": 1
                    }
                   }
                  }
                 }
                }
               }
              },
              "next": {
               "block": {
                "type": "math_change",
                "fields": {
                 "VAR": {
                  "id": "v_NK8TwtA9Rb"
                 }
                },
                "inputs": {
                 "DELTA": {
                  "shadow": {
                   "type": "math_number",
                   "fields": {
                    "NUM": 1
                   }
                  }
                 }
                }
               }
              }
             }
            }
           },
           "next": {
            "block": {
             "type": "hub_display_number",
             "inputs": {
              "N": {
               "block": {
                "type": "variables_get",
                "fields": {
                 "VAR": {
                  "id": "v_BwgzQTBfwr"
                 }
                }
               }
              }
             },
             "next": {
              "block": {
               "type": "term_println",
               "inputs": {
                "VAL": {
                 "block": {
                  "type": "variables_get",
                  "fields": {
                   "VAR": {
                    "id": "v_BwgzQTBfwr"
                   }
                  }
                 }
                }
               },
               "next": {
                "block": {
                 "type": "spike_wait_ms",
                 "inputs": {
                  "MS": {
                   "shadow": {
                    "type": "math_number",
                    "fields": {
                     "NUM": 500
                    }
                   }
                  }
                 }
                }
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "x": 40,
     "y": 246
    }
   ]
  },
  "variables": [
   {
    "name": "彩色格數",
    "id": "v_BwgzQTBfwr"
   },
   {
    "name": "第幾格",
    "id": "v_NK8TwtA9Rb"
   }
  ]
 },
 "variables": [],
 "lastFlashedHash": null
}