# Adding external sensor to the CPX and makecode

**URL:** https://forum.makecode.com/t/adding-external-sensor-to-the-cpx-and-makecode/4261
**Category:** Adafruit Circuit Playground Express
**Created:** [November 3, 2020, 8:57pm UTC](https://forum.makecode.com/t/adding-external-sensor-to-the-cpx-and-makecode/4261 "2020-11-03T20:57:19Z")
**Posts on this page:** 1
**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: [November 3, 2020, 8:57pm UTC](https://forum.makecode.com/t/adding-external-sensor-to-the-cpx-and-makecode/4261/1 "2020-11-03T20:57:19Z")

</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 CPX using makecode, I know there is one built-in to the CPX but I need to it to be external for my project !

I know I need to somehow use the i2C blocks under Advanced -\> pins in makecode but can someone point me to a working example project or offer any advice on how to use these, I know I need the block that is “ambientcolor” once the color has been detected but can I use this i2C block to get these values from an external sensor?

I am so confused! Thanks so much!
