Color & Gesture Module

Color & Gesture Module (HKBM8012F)

../../_images/09_061.png

This is a multifunctional module, the main features are Color detection and Gesture detection.

../../_images/IMG_25721.GIF

../../_images/IMG_25731.GIF

../../_images/IMG_25741.GIF

This module has 4 modes:

  1. In Color Mode, the 4 LEDs light up. It can detect color or ambient light level.

  2. In Gesture Mode, the LEDs light up corresponding to the direction of movement.

  3. In Proximity Mode, it can detect objects with a 3cm range. The LEDs brightness are determined by the proximity of the object.

  4. In LED Mode, the 4 LEDs can be controlled.

Details

../../_images/09_051.png

Specifications

  • Voltage: 3V-5V

  • Dimensions: 56mm X 24mm X 16mm

  • Connector: 4Pin PH2.0

  • Color Mode Return Value: 0-360, corresponding to hue

  • Gesture Mode Return Value: 0-4, corresponding to None, Up, Right, Down, Left

  • Proximity Mode Return Value: 0-255, with a range of approximately 3cm

  • Brightness Return Value: 0-255

Precautions

  • This module must be connected to I2C port.

  • The module defaults to Proximity Mode if mode has not been set.

  • For gesture detection, practice maybe needed to get the correct distance and speed for successful detection.

  • For color detection, the return value is a Hue value from HSV format.

  • Color detection has the best effects when the object is about 1cm away.

  • The LEDs can only be controlled in the LED Mode.

Connecting the module

Armourbit


Connect the module to the I2C Port of Armourbit using a 4Pin Cable.

../../_images/color_wire.png

Robotbit


Connect the module to the I2C Port of Robotbit.

Blue(A)->SCL, Green(B)->SDA

../../_images/gesture_wire1.png

MakeCode Coding Tutorial

../../_images/mcbanner.png

Powerbrick Extension: https://github.com/KittenBot/pxt-powerbrick

Loading Extensions

Color Gesture Module Blocks

../../_images/colorgestureblocks11.png

../../_images/colorgestureblocks21.png

Detecting Color

../../_images/color1.png

Sample Code Link

HSV Color Wheel:

../../_images/hsv1.jpg

Detecting Ambient Brightness

../../_images/colorbrightness1.png

Sample Code Link

Detecting Proximity

../../_images/colordist1.png

Sample Code Link

Detecting Gesture

../../_images/gesture1.png

Sample Code Link

Controlling LEDs

../../_images/led1.png

Sample Code Link

Makecode Tutorial Video

../../_images/gesturetut1.png

Extension Version and Updates

There may be updates to extensions periodically, please refer to the following link to update/downgrade your extension.

Makecode Extension Update

KittenBlock Coding Tutorial

../../_images/kbbanner.png

Load Powerbrick Extension

Select Powerbrick from the hardware column.

../../_images/addextension1.png

Color Gesture Module Blocks

../../_images/kbcolorgestureblocks1.png

Detecting Color

../../_images/kbcolor1.png

Sample Code Download

Detecting Ambient Brightness

../../_images/kbbrightness1.png

Sample Code Download

Detecting Proximity

../../_images/kbcolordist1.png

Sample Code Download

Detecting Gesture

../../_images/kbgesture1.png

Sample Code Download

Controlling LEDs

../../_images/kbled1.png

Sample Code Download

FAQ

1:Why is there no reaction when I click the blocks?

Make sure you have connected the Micro:bit correctly and flash the firmware again.