Legacy edition, no longer supported: SharpShot Vision units shipped before 2026-10 (School and WRO editions) are no longer supported; their guides and examples stay here for reference. To upgrade to the current SharpShot Vision, contact the distributor you bought it from and send it back: the firmware update is free, and the buyer pays shipping both ways. Looking for the current SharpShot Vision? →
MBC SharpShot Vision (ESP32CAM) School edition × micro:bit (MakeCode)

Read the SharpShot with a micro:bit in three steps

In MakeCode for micro:bit, first add the MBC extension, then wait for the camera in "on start", and last put a reading block into "forever". Follow the steps on the left, and the blocks on the right grow with you. The block pictures come from MakeCode's own renderer, so they look the same as in the editor. Switch to JavaScript at the top right, just like the switch in MakeCode.

MakeCode is free and needs no login. Open it in Chrome or Edge. Click "Download" to save a .hex file and drag it onto the micro:bit.

1

Add the MBC extension and wire it up

The micro:bit does not know the SharpShot yet. After you add the MBC extension, an "MBC Sensors" category appears, and the SharpShot blocks are in its "Camera" group. Pick your micro:bit version first; the hardware check below changes with it.

Which micro:bit do you have? (V2 has "V2" printed on the back)
  1. Open MakeCode and click "New Project".
  2. At the bottom of the toolbox, click "Advanced" → "Extensions".
  3. Paste https://github.com/contactmbcrobot/pxt-mbc-sensors into the search box, press Enter and click mbc-sensors.
  4. The blocks are in English. (Traditional Chinese is also included in the extension.)
2

On start: wait for the camera

The camera needs a few seconds to start. The program first waits until it is ready: tick = connected, cross = not connected. You find wiring problems at once.

I2C address of the sensor
  1. From "Logic", drag "if … then … else" into "on start".
  2. From "MBC Sensors" → "more", drag "wait for device at … ready, timeout … ms" into the condition. Pick 76 (0x4C) and type 3000.
  3. From "Basic", drag two "show icon" blocks: one tick, one cross.
  4. Put "pause 100 ms" into "forever".

3

Use the reading blocks

The "MBC Sensors → Camera" group has blocks for the blob position, colour, motion, events and more. The "Device" group has shared blocks that every MBC sensor has. Pick one, and the blocks and the output switch to its example.

Sensor simulator (what the camera sees): drag the blob and watch the output on the right

The simulator is only a picture. The maths is simpler than the real thing, and a real camera can be a few steps off because of the light. Cross = sample point (the spot you pick on the camera in "Setup 1: COLOR"); the colour is read at the cross. Green box = the blob the camera tracks (the colour you pick in "Setup 2: TRACK"). X: left 0, right 100. Y: small at the bottom, big at the top (top 75).

An example for every block

Every block of the Camera group and the Device group has an example you can copy (address 0x4C). Click "Try it" to jump to step 3, and the blocks and output on the right switch to that example.

Good to know

  1. Unplugging does not stop the program: when the camera cannot be read, reading blocks return 0 (true/false blocks return false), and nothing is printed. So "hue = 0" can mean "red" or "not connected". Use "device at … is ready" to tell them apart. Tick "Unplug the sensor" below and try it: even "on camera blob lost" fires.
  2. Check for a blob first: when no blob is found, blob X, Y, width, height and area are all 0, which looks like "a blob in the bottom-left corner". Use "camera blob is found" before you read the position.
  3. Colours are set on the camera: the colour values (hue, saturation, brightness) come from the sample point of "Setup 1: COLOR", and the blob uses the colour of "Setup 2: TRACK". You can only set them with the buttons on the camera. Without Setup 1 the hue stays 0, the same as red.
  4. Directions: stand behind the robot and look forward. X: left 0, right 100, centre about 50 (X − 50: left negative, right positive). Y is small at the bottom and big at the top (top 75). Hue 0–100: red 0 (100 is also red), yellow about 17, green about 33, cyan about 50, blue about 67, magenta about 83; −1 = black, white or grey.
  5. The WRO-edition blocks (camera spot …) do not work on the School edition: colour code and vividness read 0, and "camera spot … is …" always returns false. Use only the blocks above with the School edition. The WRO edition (HUE12) has its own tutorial page.
  6. The camera is an ESP32: it cannot make the micro:bit wait (no clock stretching). The extension already waits 2 ms after writing the value id, so you do not need an extra pause.