# Micro:bit and external color sensor?

**URL:** <https://forum.makecode.com/t/micro-bit-and-external-color-sensor/15370>\
**Category:** micro:bit extensions\
**Created:** [September 15, 2022, 11:10pm UTC](https://forum.makecode.com/t/micro-bit-and-external-color-sensor/15370 "2022-09-15T23:10:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mathpun](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@mathpun](https://forum.makecode.com/u/mathpun)\
**Post date:** [September 15, 2022, 11:10pm UTC](https://forum.makecode.com/t/micro-bit-and-external-color-sensor/15370/1 "2022-09-15T23:10:14Z")

</div>

Hello! I am trying to connect an external color sensor ([https://www.adafruit.com/product/1356](https://www.adafruit.com/product/1356)) to the micro:bit V2 using makecode. It needs to be an external sensor for my project.

I think I need an extension in makecode? I see this one but I cant get the code working. [https://makecode.microbit.org/pkg/joy-it/pxt-SEN-Color](https://makecode.microbit.org/pkg/joy-it/pxt-SEN-Color)

do you think I could use this? How would the code work? I want an etrnal LED to show the color from the sensor!

I am so confused! Thanks so much!

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [September 15, 2022, 11:26pm UTC](https://forum.makecode.com/t/micro-bit-and-external-color-sensor/15370/2 "2022-09-15T23:26:01Z")

</div>

That extension looks like it was written for the TCS3200, but the sensor you linked uses the TCS34725. I’m not sure how compatible those two sensors are.

I don’t know of any existing extensions for that flora sensor, but since it communicates over i2c you might be able to use the i2c blocks:

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/a/af6545a7beee0fc86bb39aa7e5e0d5e184e07ae7.png)

You can find them under the “more” subcategory that appears when you open the “pins” category.

To figure out the i2c protocol, you can either try [the data sheet](https://cdn-shop.adafruit.com/datasheets/TCS34725.pdf) or potentially take a look at converting the C++ code in [adafruit’s arduino library](https://github.com/adafruit/Adafruit_TCS34725).

---

<div class="post-metadata">

**Author:** ![mathpun](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@mathpun](https://forum.makecode.com/u/mathpun)\
**Post date:** [September 16, 2022, 2:20am UTC](https://forum.makecode.com/t/micro-bit-and-external-color-sensor/15370/3 "2022-09-16T02:20:55Z")

</div>

Cool, will check this out! Thanks so much!

---

<div class="post-metadata">

**Author:** ![MKleinSB](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mkleinsb/32/593_2.png) [@MKleinSB](https://forum.makecode.com/u/MKleinSB)\
**Post date:** [September 19, 2022, 4:01pm UTC](https://forum.makecode.com/t/micro-bit-and-external-color-sensor/15370/4 "2022-09-19T16:01:26Z")

</div>

Try this one

> **[GitHub - samnied/pxt-tcs34725: Makecode extension for TCS34725 I2C color sensor](https://github.com/samnied/pxt-tcs34725)**
>
> Makecode extension for TCS34725 I2C color sensor. Contribute to samnied/pxt-tcs34725 development by creating an account on GitHub.
