KOI MakeCode Quickstart Guide
Last updated
Last updated
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)
As Robotbit can supply 5V power, there is no need to power KOI with an USB cable.
Please pay attention in connecting the power wires to the Robotbit.
xxx DO NOT connect it in the wrong way. xxx
Or KOI may not function correctly, it may even suffer damage.
Using the cable included with KOI, connect KOI to Robotbit using Dupont wires.
The Dupont wires are arranged as: Black, Red, Blue, Green
These wires correspond to: GND, 5V, P2, P12
As Robotbit can supply 5V power, there is no need to power KOI with an USB cable.
Please pay attention in connecting the power wires to the Robotbit.
xxx DO NOT connect it in the wrong way. xxx
Or KOI may not function correctly, it may even suffer damage.
Using the cable included with KOI, connect KOI to Robotbit using Dupont wires.
The Dupont wires are arranged as: Black, Red, Blue, Green
These wires correspond to: GND, 5V, P1(TX), P12(RX)
Do not connect Red to Ground and Black to 5V!!!
Ensure the connection is correct and switch the power on.
Search "KOI" in the search bar.
Or copy and paste the following link to the search bar.
https://github.com/KittenBot/pxt-koi
This section briefly explains the functions of blocks.
Please refer to tutorials for detailed tutorial and sample codes.
1st Block —— is used for Robotbit.
2nd Block —— is used for Armourbit.
It is easier to understand Classifier blocks if you are already familiar with ML5 extension on Kittenblock.
Classifier is used to train and run a customized model for object/scene classification.
Micro SD card is required for this function to work.
The Screenshot block creates a png file and saves it onto the SD card. The name must not contain spaces.
The Display block finds the file on the SD Card then displays it on the screen for 1 second. The name must not contain spaces.
The print block shows a string at the specific coordinates. It shows the text for 1 second by default, this duration can be changed via delay.
Since KOI cannot detect the direction of the camera, the display orientation has to be set manually so that the image corresponds to camera direction.
There are 2 modes, Front, Back. (Refer to figure below.)
A threshold can be adjusted, a higher value can filter out more noise and interferences, but tracking difficulty increases as well.
Tracking circle returns 3 values, the coordinates of the circle as well as the radius.
Similar to Circle Tracking, the threshold can be adjusted.
Rectangle Tracking returns the coordinates of the rectangle and its width and height.
Calibration is required before tracing lines or color blobs.
Line Tracing returns the starting and ending coordinates of the line.
Color Blob Tracing returns the coordinates of the blob and its width and height.
Scans and returns the contents of the Barcode/QRCode.
The Barcode/QRCode should not be smaller than 3.5cm in width or the resoulution is too small to be recognized.
Apriltags are seldomly used in Hong Kong, this tag is usually used in robots.
Apriltags Recognition returns an id and its geometric attributes.
Load the face model before detecting faces.
Runs the model once to detect faces.
Returns the coordinates of the face.
Micro SD card is required for this function to work.
This function records and plays a wav file from the SD card.
When the button is pressed, it returns 1, otherwise 0 is returned.
There may be updates to extensions periodically, please refer to the following link to update/downgrade your extension.