# Built-in Tracking: Color Balls

### MakeCode Programming Tutorial

#### Extension link: [**https://github.com/KittenBot/pxt-koi2**](https://github.com/KittenBot/pxt-koi2)

Search for KOI2 in the search bar, select KOI 2.(KOI 2 has been approved by Microsoft)

<figure><img src="https://686851495-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7Bv9xBdKh3R9w6Vp7asd%2Fuploads%2Fl4LAJvAYYE9RTHdxFSja%2FlALPGTO6sYhE8bbNAo7NBVw_1372_654.png?alt=media&#x26;token=fcce3ddf-c398-4075-9248-bba1b14267cd" alt=""><figcaption></figcaption></figure>

The extension will be imported into your project.

### Coding Blocks

<figure><img src="https://686851495-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7Bv9xBdKh3R9w6Vp7asd%2Fuploads%2FC8hnwTmZfe9lkvLIeqpd%2Fimage.png?alt=media&#x26;token=e86c0d18-fa3f-4f16-a2d2-a6ad402356b4" alt=""><figcaption></figcaption></figure>

### Sample Program

{% hint style="info" %}
Armourbit users need to use the corresponding initialization block
{% endhint %}

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6uJvpXC43onNIIwhMlWo%2Fuploads%2FPGyECwlPd2M3JqUBLDfO%2Fimage.png?alt=media&#x26;token=662ace3f-a8eb-4fbf-8a10-1d9643c88b1e" alt=""><figcaption></figcaption></figure>

{% embed url="<https://makecode.microbit.org/_5bRLAUPwXFr3>" %}

[Sample Program](https://makecode.microbit.org/_5bRLAUPwXFr3)

#### Sample Program Operations

1. KOI will track the balls automatically, the ID will be displayed on the Micro:bit.
2. Press Button A on the Micro:bit to show the coordinates of the ball.
