KOI 2 in MakeCode Quick Start Guide
Wiring
1. Use with Robotbit EDU
Use the cable included to connect KOI to Robotbit.
Connect KOI 2 to the serial port of the Robotbit EDU as shown in the illustration.
As Robotbit EDU uses P2 and P12 for its serial port, you will need to select the appropiate pins in the MakeCode program.
If you wish to power the KOI using USB power, please remove the black(GND) and red(5V) wires.
![](https://sharinghub-eng.kittenbot.hk/~gitbook/image?url=https%3A%2F%2F686851495-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F7Bv9xBdKh3R9w6Vp7asd%252Fuploads%252FlSf5amP5cH73qyYeGQFg%252Fedu_wiring.png%3Falt%3Dmedia%26token%3D4bb63a7b-308e-4988-9b7b-52a91384bf1b&width=768&dpr=4&quality=100&sign=3ad66d06&sv=1)
KOI 2 RX Port(Yellow) Connects to Robotbit TX Port(P2)
KOI 2 TX Port(Blue) Connects to Robotbit RX Port(P12)
![](https://sharinghub-eng.kittenbot.hk/~gitbook/image?url=https%3A%2F%2F686851495-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F7Bv9xBdKh3R9w6Vp7asd%252Fuploads%252FsDbsOJzjAozndzQpnOnN%252Fimage.png%3Falt%3Dmedia%26token%3D69d4e5f0-f2d6-4697-98cb-3c02e02a8223&width=768&dpr=4&quality=100&sign=69b0c1c0&sv=1)
2. Use with Robotbit 2.2
Use the cable included to connect KOI to Robotbit.
Refers to the following illustration for correct wiring.
Black - GND
Red - 5V
Yellow - P2 (TX)
Blue - P12 (RX)
![](https://sharinghub-eng.kittenbot.hk/~gitbook/image?url=https%3A%2F%2Fkittenbothk.readthedocs.io%2Fen%2Flatest%2F_images%2Frobotbit_connection1.png&width=768&dpr=4&quality=100&sign=ac3b815e&sv=1)
Do not connect Red to Ground and Black to 5V!!!
Ensure the connection is correct and switch the power on.
![](https://sharinghub-eng.kittenbot.hk/~gitbook/image?url=https%3A%2F%2Fkittenbothk.readthedocs.io%2Fen%2Flatest%2F_images%2Frobotbit_connection2.png&width=768&dpr=4&quality=100&sign=1b2a8819&sv=1)
![](https://sharinghub-eng.kittenbot.hk/~gitbook/image?url=https%3A%2F%2Fkittenbothk.readthedocs.io%2Fen%2Flatest%2F_images%2Frobotbit_connection3-1.png&width=768&dpr=4&quality=100&sign=3325103e&sv=1)
3. Use with Armourbit
It is easier to connect to an Armourbit because they both use PH2.0 connectors.
When using KOI with an Armourbit, KOI needs an extra 5V power source.
Using the USB port on the battery box, 5V power can be supplied to KOI. (See figure below)
![](https://sharinghub-eng.kittenbot.hk/~gitbook/image?url=https%3A%2F%2Fkittenbothk.readthedocs.io%2Fen%2Flatest%2F_images%2Farmourbit_connection1-1.png&width=768&dpr=4&quality=100&sign=ec1f1f18&sv=1)
![](https://sharinghub-eng.kittenbot.hk/~gitbook/image?url=https%3A%2F%2Fkittenbothk.readthedocs.io%2Fen%2Flatest%2F_images%2Farmourbit_connection2-3.png&width=768&dpr=4&quality=100&sign=bc9c1699&sv=1)
Use the corresponding programming block and select the correct port.(Default Port 1)
![](https://sharinghub-eng.kittenbot.hk/~gitbook/image?url=https%3A%2F%2F686851495-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F7Bv9xBdKh3R9w6Vp7asd%252Fuploads%252FqeXA5PtQhvUKkWL2z9sn%252Fimage.png%3Falt%3Dmedia%26token%3D00f6d7c6-dbe7-4c68-99ed-46a4be8cc99d&width=768&dpr=4&quality=100&sign=338536ea&sv=1)
MakeCode Extension Quick Guide
Import KOI 2 Extension for MakeCode
Extension Address:
Open the extension tab in MakeCode.
![](https://sharinghub-eng.kittenbot.hk/~gitbook/image?url=https%3A%2F%2Fkittenbothk.readthedocs.io%2Fen%2Flatest%2F_images%2F16-1.png&width=768&dpr=4&quality=100&sign=3f9b2d7c&sv=1)
Search for KOI2 in the search bar, select KOI 2.(KOI 2 has been approved by Microsoft)
![](https://sharinghub-eng.kittenbot.hk/~gitbook/image?url=https%3A%2F%2F686851495-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F7Bv9xBdKh3R9w6Vp7asd%252Fuploads%252Fl4LAJvAYYE9RTHdxFSja%252FlALPGTO6sYhE8bbNAo7NBVw_1372_654.png%3Falt%3Dmedia%26token%3Dfcce3ddf-c398-4075-9248-bba1b14267cd&width=768&dpr=4&quality=100&sign=951555fd&sv=1)
The extension will be imported into your project.
![](https://sharinghub-eng.kittenbot.hk/~gitbook/image?url=https%3A%2F%2Ffiles.gitbook.com%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsN6MlwBFbL3P67FzMMyL%252Fuploads%252FSkO076z0lrID98zSivpa%252Fimage.png%3Falt%3Dmedia%26token%3D41cbc34a-9933-49f6-a4ce-62c0af2e6822&width=768&dpr=4&quality=100&sign=f91db4aa&sv=1)
1. Initialization
![](https://sharinghub-eng.kittenbot.hk/~gitbook/image?url=https%3A%2F%2Ffiles.gitbook.com%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsN6MlwBFbL3P67FzMMyL%252Fuploads%252FjPCDYYmTZPo2Jnzf1RyN%252Fimage.png%3Falt%3Dmedia%26token%3Dfb13d3f5-af5e-4b57-9db6-6492ac512aaa&width=768&dpr=4&quality=100&sign=3f1cf3c6&sv=1)
Initializes the communication between KOI 2 and Micro:bit, must be included at the top of the program.
2. Basic Operation
![](https://sharinghub-eng.kittenbot.hk/~gitbook/image?url=https%3A%2F%2Ffiles.gitbook.com%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsN6MlwBFbL3P67FzMMyL%252Fuploads%252Fg8gveE0DC4idrYoORQEx%252Fimage.png%3Falt%3Dmedia%26token%3D97b18306-46f0-43d8-8aba-690e1ac10ca3&width=768&dpr=4&quality=100&sign=4de70e88&sv=1)
Basic Operations for KOI 2 such as taking pictures and showing text.
3. Function Selection
![](https://sharinghub-eng.kittenbot.hk/~gitbook/image?url=https%3A%2F%2Ffiles.gitbook.com%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsN6MlwBFbL3P67FzMMyL%252Fuploads%252FekJiYjyUbxlSyxEZst79%252Fimage.png%3Falt%3Dmedia%26token%3D3ac5b3d8-231d-4815-a6f7-b0d4e7b5895c&width=768&dpr=4&quality=100&sign=e53d94ce&sv=1)
Switching function is required to run the corresponding AI function.
4. Face Tracking
![](https://sharinghub-eng.kittenbot.hk/~gitbook/image?url=https%3A%2F%2Ffiles.gitbook.com%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsN6MlwBFbL3P67FzMMyL%252Fuploads%252F4NqJm2V0GxQz4VCrHMom%252Fimage.png%3Falt%3Dmedia%26token%3Dea871158-217c-4b7a-aa85-378910511885&width=768&dpr=4&quality=100&sign=a4a7eee5&sv=1)
5. Face Mask
![](https://sharinghub-eng.kittenbot.hk/~gitbook/image?url=https%3A%2F%2Ffiles.gitbook.com%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsN6MlwBFbL3P67FzMMyL%252Fuploads%252FM8Wgv7SSdEBIsp8KvNYk%252Fimage.png%3Falt%3Dmedia%26token%3D14a13c24-be54-4cd2-819a-9caac5971deb&width=768&dpr=4&quality=100&sign=7d3bb12e&sv=1)
6. Color Blob Tracking
![](https://sharinghub-eng.kittenbot.hk/~gitbook/image?url=https%3A%2F%2Ffiles.gitbook.com%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsN6MlwBFbL3P67FzMMyL%252Fuploads%252FqLOoRdzxjrDItARCGQoe%252Fimage.png%3Falt%3Dmedia%26token%3D9214c3d0-86fe-4a2f-adc3-8acde2705a1e&width=768&dpr=4&quality=100&sign=6b3efaf4&sv=1)
7. Line Follower
![](https://sharinghub-eng.kittenbot.hk/~gitbook/image?url=https%3A%2F%2Ffiles.gitbook.com%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsN6MlwBFbL3P67FzMMyL%252Fuploads%252FONDuKNPPQqvb0eUB6cmr%252Fimage.png%3Falt%3Dmedia%26token%3D35c455e1-e03d-4689-960e-ee8d64cfec35&width=768&dpr=4&quality=100&sign=a90896d3&sv=1)
8. Image Classifier
![](https://sharinghub-eng.kittenbot.hk/~gitbook/image?url=https%3A%2F%2Ffiles.gitbook.com%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsN6MlwBFbL3P67FzMMyL%252Fuploads%252FKJBCamCme1kOp87DZSyo%252Fimage.png%3Falt%3Dmedia%26token%3D86c63e73-8232-4693-9be0-9050a915bbc4&width=768&dpr=4&quality=100&sign=b5cb41a0&sv=1)
9. Built-in Tracking: Traffic Sign
10. Built-in Tracking: Numbers
![](https://sharinghub-eng.kittenbot.hk/~gitbook/image?url=https%3A%2F%2Ffiles.gitbook.com%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsN6MlwBFbL3P67FzMMyL%252Fuploads%252FcSBWcbLHC7EmzXJtVODY%252Fimage.png%3Falt%3Dmedia%26token%3Dc7c88a1a-7230-40fa-aa77-7f670d635ea2&width=768&dpr=4&quality=100&sign=931286d4&sv=1)
11. Built-in Tracking: Common Items
![](https://sharinghub-eng.kittenbot.hk/~gitbook/image?url=https%3A%2F%2Ffiles.gitbook.com%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsN6MlwBFbL3P67FzMMyL%252Fuploads%252FcdrSY8oosgOkO5QZqcAJ%252Fimage.png%3Falt%3Dmedia%26token%3Da11b81a3-c3a4-4ea8-8213-57eed61585b0&width=768&dpr=4&quality=100&sign=ea88cb82&sv=1)
12. Code Scanner
13. WiFi IoT
Last updated