Sorting Manipulator | Maqueen Mechanic Getting Started Guide Lesson 7

7-1. Project Introduction

This project mainly uses the color recognition function of HUSKYLENS to place objects of different colors recognized into the corresponding areas. For example, if the color of the recognized object is red, the object will be placed into the left area; if it is blue, place it into the right area.

Note: this project should use 1000mAh lithium battery.

7-2. Hardware Preparation

projectImage

7-3. Installation Steps

projectImage

7-4. Color Learning of HUSKYLENS

HUSKYLENS sensor employs the built-in algorithm to identify the ID of different colors and feed them back to the main controller board by learning and recording different colors.

The HUSKYLENS sensor is set by default to learn, recognize and track only one color, but we can set it to recognize multiple colors.

1. Choose “Color Recognition” function

Dial the function button to the left until the word "Color recognition" is displayed at the top of the screen.

projectImage

Long press the “function button”to enter the parameter setting of the color recognition function. Dial the function button until "Learn Multiple" is displayed, then short press the function button, and dial to the right to turn on the "Learn Multiple" switch, that is, progress bar turns blue and the square icon on the progress bar moves to the right. Then short press the function button to confirm this parameter.

projectImage

Dial the function button to the left until "Save & Return" shows. And the screen prompts "Do you want to save the parameters?" Select "Yes" in default, now short-press the function button to save the parameters and return automatically.

2. Color Learning

projectImage

Point the “+” symbol at the color, long press the "learning button" to learn the first color. Then release the "learning button", a message "Click again to continue! Click other buttons to finish" will be displayed. Please short press the "learning button" before the countdown ends if you want to learn another color. If not, short press the "function button" before the countdown ends, or do not press any button to let the countdown ends.

projectImage

3. Color Recognition

When encountering the same or similar color blocks, a frame with an ID will be automatically displayed on the screen, and the size of the frame is the same as the size of the color blocks.

projectImage

Note: Color recognition is greatly affected by ambient light. Sometimes HUSKYLENS may misidentify similar colors. Please try to use the sensor in environments with unchanged and suitable ambient light

7-5. Program Link

https://makecode.microbit.org/_DADUjjTvsED1

7-6. Program Screenshot

projectImage

7-7. Effect Display

If the color detected is red, the Maqueen car turns left and places the object in the red area on the left; if it is blue, turns right and places the object in the blue area on the right.

projectImage
projectImage

Note: The object needs to be placed within the gripping range.

License
All Rights
Reserved
licensBg
0