# Adafruit ESP32-C6 Feather

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/131/878/medium800/adafruit_products_5933-06.jpg?1723749573)

The ESP32-C6 is Espressif's first WiFi 6 SoC integrating 2.4 GHz WiFi 6, Bluetooth 5 (LE) and the 802.15.4 protocol. It brings the goodness you know from the [low-cost C3 series](https://www.adafruit.com/product/5337) and improves it with Zigbee/802.15.4 at 2.4 Ghz.&nbsp;[That means it could make for great Matter development hardware](https://csa-iot.org/all-solutions/matter/)!

![](https://cdn-learn.adafruit.com/assets/assets/000/131/879/medium800/adafruit_products_5933-03.jpg?1723749628)

We took our [Feather ESP32-S2](https://www.adafruit.com/product/5000) and swapped out the 'S2 for a C6. Plus some re-routing and here's what we've got: a C6 Feather with lots of GPIO, [lipoly charging and monitoring with the MAX17048](https://www.adafruit.com/product/5580), NeoPixel, I2C Stemma QT port, and a second low-quiescent LDO for disabling the I2C and NeoPixel when we want ultra-low power usage - as low as 17uA in deep sleep.

![](https://cdn-learn.adafruit.com/assets/assets/000/131/880/medium800/adafruit_products_5933-04.jpg?1723749724)

One thing to watch for is that, like the C3, the C6 does _not_ have native USB. It does have a 'built in' USB Serial core that can be used for debugging, but it _cannot_ act like a mouse, keyboard, or disk drive. That means [if you are running CircuitPython](https://circuitpython.org/board/adafruit_feather_esp32c6_4mbflash_nopsram/) you will need to use WiFi, Bluetooth or WebSerial for transferring files back and forth rather than drag-and-dropping to a drive. Ditto for the bootloader side, this chip cannot run UF2.

![](https://cdn-learn.adafruit.com/assets/assets/000/131/881/medium800/adafruit_products_5933-05.jpg?1723749730)

Another thing to be aware of is the ESP32-C6 does not have as many GPIO as the ESP32-S2 or ESP32-S3, so **A2** is the same GPIO pin as **IO6** and **A3** is the same pin as **IO5**. However, this gives it the most compatibility with our existing FeatherWings.

![](https://cdn-learn.adafruit.com/assets/assets/000/131/882/medium800/adafruit_products_5933-02.jpg?1723749798)

# Adafruit ESP32-C6 Feather

## Pinouts

![](https://cdn-learn.adafruit.com/assets/assets/000/131/943/medium800/adafruit_products_double.jpg?1724167914 front and back view of the C6 feather)

![](https://cdn-learn.adafruit.com/assets/assets/000/139/939/medium800/adafruit_products_Adafruit_Feather_ESP32-C6_PrettyPins_2.png?1758739123)

Link to PrettyPins PDF&nbsp;[on GitHub](https://github.com/adafruit/Adafruit-ESP32-C6-Feather-PCB/blob/main/Adafruit%20Feather%20ESP32-C6%20PrettyPins%202.pdf).

## Power
![](https://cdn-learn.adafruit.com/assets/assets/000/131/944/medium800/adafruit_products_power.jpg?1724167970)

There are two ways you can power the ESP32-C6 Feather, as well as other related pins.

- **USB-C port** - This is used for both powering and programming the board. You can power it with any USB C cable. When USB is plugged in it will charge the Lipoly battery.
- **LiPoly connector/charger** - You can plug in any 250mAh or larger 3.7/4.2V Lipoly battery into this **JST 2-PH port** to both power your Feather and charge the battery. The battery will charge from the USB power when USB is plugged in. If the battery is plugged in _and USB is plugged in_, the Feather will power itself from USB _and_ it will charge the battery up.
- **Chg LED** - When the battery is charging, the yellow CHG LED will be lit. When charging is complete, the LED will turn off. If there's no battery plugged in, the CHD LED may blink rapidly - this is expected!
- **GND** - This is the common ground for all power and logic.
- **BAT** - This is the positive voltage to/from the 2-pin JST jack for the optional Lipoly battery.
- **USB** - This is the positive voltage to/from the USB C jack, if USB is connected.
- **EN** - This is the 3.3V regulator's enable pin. It's pulled up, so connect to ground to disable the 3.3V regulator.
- **3.3V** - These pins are the output from the 3.3V regulator, they can supply 500mA peak.

![](https://cdn-learn.adafruit.com/assets/assets/000/131/945/medium800/adafruit_products_chargeDisable.jpg?1724168058)

On the back of the Feather is a jumper labeled **Charger Disable**. If you cut this jumper, you'll disable the LiPoly battery charging circuit. This means that you could use the JST-PH battery port with non-LiPoly batteries, such as AA or AAA battery packs.

## ESP32-C6 WiFi Module
![](https://cdn-learn.adafruit.com/assets/assets/000/131/946/medium800/adafruit_products_c6.jpg?1724168177)

This is the **ESP32-C6 module**. It is a 32-bit RISC-V single-core processor that operates at up to 160 MHz. This version of the module has 4MB of flash and no PSRAM. It supports WiFi 6 in a 2.4GHz band, Bluetooth 5, Zigbee 3.0, and Thread. It's pin-to-pin compatible with the ESP32-WROOM series module. With low-power consumption, it is an ideal choice for a variety of IoT projects!

## MAX17048 Battery Monitor
![](https://cdn-learn.adafruit.com/assets/assets/000/131/947/medium800/adafruit_products_max.jpg?1724168238)

The&nbsp; **Adafruit MAX17048 LiPoly / LiIon Fuel Gauge and Battery Monitor** reports the voltage and charge percent over I2C. Connect it to your&nbsp;[Lipoly or LiIon battery](https://www.adafruit.com/category/916)&nbsp;and it will let you know the voltage of the cell, and it does the annoying math of decoding the non-linear voltage to get you a valid percentage as well!

The battery monitor is available over I2C on address&nbsp; **0x36**.

Our&nbsp;[Arduino](https://github.com/adafruit/Adafruit_MAX1704x)&nbsp;or&nbsp;[CircuitPython/Python](https://github.com/adafruit/Adafruit_CircuitPython_MAX1704x)&nbsp;library code allows you to read the voltage and percentage whenever you like. There is no pin on the ESP32-C6 Feather that returns battery voltage, but this I2C monitor makes it super simple to get that data!

## Logic Pins
![](https://cdn-learn.adafruit.com/assets/assets/000/131/948/medium800/adafruit_products_logic.jpg?1724168342)

These are the logic pins that can be used to connect FeatherWings, sensors, servos, LEDs and more!

There are three sets of shared pins on the Feather: Boot/NeoPixel/IO9, A2/IO6 and A3/IO5. Be careful when using these pins.

There are six analog pins:

- **A0 thru A5** can also be analog inputs.

Info: The ESP32-C6 Feather does not have a DAC, so you cannot do true analog out.

ESP32 chips allow for 'multiplexing' of almost all signals. There is support for SPI, UART, I2C, I2S, RMT, TWAI, and PWM on&nbsp;_any_ pin. The Feather has a few specially designated pins for pin compatibility with FeatherWings and preexisting code:

The SPI pins:

- **SCK** - This is the SPI clock pin (IO21).
- **MOSI** - This is the SPI **M** icrocontroller **O** ut / **S** ensor **I** n pin (IO22).
- **MISO** - This is the SPI **M** icrocontroller **I** n / **S** ensor **O** ut pin (IO23).

The UART interface:

- **RX** - This is the UART receive pin (IO17). Connect to TX (transmit) pin on your sensor or breakout.
- **TX** - This is the UART transmit pin (IO16). Connect to RX (receive) pin on your sensor or breakout.

The I2C interface. This is shared by the STEMMA QT connector.

- **SCL** - This is the I2C clock pin (IO18). There is a 5k pullup on this pin.
- **SDA** - This is the I2C data pin (IO19). There is a 5k pullup on this pin.
- In CircuitPython, you can use the STEMMA connector with&nbsp;`board.SCL`&nbsp;and&nbsp;`board.SDA`, or&nbsp;`board.STEMMA_I2C()`. In Arduino, you can access these pins with `Wire`.
- There is an I2C power pin (IO20) that needs to be pulled high for the STEMMA QT connector to work properly.&nbsp; **CircuitPython and Arduino do this automatically.** It is available in CircuitPython and Arduino as `NEOPIXEL_I2C_POWER`. This pin also controls the NeoPixel power.

The digital pins:

- **IO0, IO5-IO9, IO12, IO15** - These are digital pins. IO9 is shared with the Boot button and onboard NeoPixel, IO6 is shared with A2 and IO5 is shared with A3.

_Check the ESP32-C6 datasheet or the PrettyPins diagram above for more details on each pin if you need them!_

## NeoPixel and Red LED
![](https://cdn-learn.adafruit.com/assets/assets/000/131/949/medium800/adafruit_products_leds.jpg?1724168787)

There are two LEDs you can control in code.

- **NeoPixel LED** - This addressable RGB NeoPixel LED, labeled **Neo** on the board, can be controlled with code. It does _not_ act as a status LED in CircuitPython because it shares a pin with the **Boot** button ( **IO9** ). It is available in CircuitPython as `board.NEOPIXEL`, and in Arduino as `PIN_NEOPIXEL`.
- There is a NeoPixel power pin that needs to be pulled high for the NeoPixel to work. It is the same pin as the I2C power pin (IO20).&nbsp; **This is done automatically by CircuitPython and Arduino.** It is available in CircuitPython and Arduino as&nbsp;`NEOPIXEL_I2C_POWER`.
- **Red LED** - This little red LED, labeled **15** on the board, is on or blinks during certain operations (such as pulsing when in the bootloader), and is controllable in code. It is available in CircuitPython as `board.LED`, and in Arduino as `LED_BUILTIN` or `15`.

Warning: The NeoPixel and Boot button are both connected to IO9.

## STEMMA QT
![](https://cdn-learn.adafruit.com/assets/assets/000/131/950/medium800/adafruit_products_stemma.jpg?1724168943)

This **JST SH 4-pin [STEMMA QT](https://learn.adafruit.com/introducing-adafruit-stemma-qt) connector** breaks out I2C (SCL, SDA, 3.3V, GND). It allows you to connect to [various breakouts and sensors with **STEMMA QT** connectors](https://www.adafruit.com/category/1018) or to other things using&nbsp;[assorted associated accessories](https://www.adafruit.com/?q=JST%20SH%204). It works great with any STEMMA QT or Qwiic sensor/device. You can also use it with Grove I2C devices thanks to [this handy cable](https://www.adafruit.com/product/4528).

There is a power pin ( **IO20** ) that must be pulled high for the STEMMA QT connector to work.&nbsp; **This is done automatically in CircuitPython and Arduino.&nbsp;** The pin is available in CircuitPython&nbsp;and Arduino as `NEOPIXEL_I2C_POWER`. You can manually cut power to the QT port completely by setting this pin to an output and low. This will disable power to the connector for low power usage.

## Buttons
![](https://cdn-learn.adafruit.com/assets/assets/000/131/951/medium800/adafruit_products_buttons.jpg?1724169135)

There are two buttons on the ESP32-C6 Feather.

- **Reset button** - This button restarts the board and helps enter the bootloader. You can click it once to reset the board without unplugging the USB cable or battery.&nbsp;
- The **RST pin** is can be used to reset the board. Tie to ground manually to reset the board.
- **Boot button** - This button can be read as an input in code. It is connected to pin **IO9** , which is also broken out separately on the Feather. It is available as `board.BUTTON` in CircuitPython, and pin `9` in Arduino. Simply set it to be an input with a pullup. **This pin is shared with the onboard NeoPixel.** This button can also be used to put the board into&nbsp;_ROM bootloader mode_. To enter ROM bootloader mode, hold down DFU button while clicking reset button mentioned above. When in the ROM bootloader, you can upload code and query the chip using `esptool`.

# Adafruit ESP32-C6 Feather

## Low Power Use

This microcontroller board can be used for low power usage thanks to the ESP32's multiple sleep modes.

There are three basic operating states to Espressif chips: normal, light sleep and deep sleep.

**Normal power** usage is as you expect: you can use the chip and run code as you like - connecting to WiFi, reading sensors, etc.

**Light sleep** is sort of a 'hibernation' - power usage is minimal and WiFi is disconnected, but the internal clock and memory is kept. That means you can wake up where you left off, in the middle of the code as desired. You'll still need to re-initialize any external hardware that got disconnected, and WiFi, but it's often faster than waking from a deep sleep

**Deep sleep** is the lowest power but the tradeoff is that all memory and state is lost - the only thing that's running is the real time clock that can wake the chip up. When woken up, the chip starts as if it was physically reset - from the beginning of the code. This can be beneficial if you want to have a fresh start each time

A _rough_ guideline is:

- Normal power: 100mA+ can be as much power as need and spike during WiFi connection
- Light sleep: 2mA assuming all external hardware is de-powered
- Deep sleep: 100uA assuming all external hardware is de-powered

The Adafruit ESP32-C6 Feather has a `NEOPIXEL_I2C_POWER` pin that controls power to I2C and the NeoPixel LED. This pin is automatically pulled HIGH in both CircuitPython and Arduino. Disabling this pin by setting it to an output and LOW allows you to drop the power draw, even when you have I2C sensors or breakouts connected.

Here's a generic sketch we use for all our boards that has a macro-defined section for enabling and disabling all external powered elements. For example, if there's a power pin for NeoPixels, I2C port, TFT, etc...we turn that off before going into light or deep sleep! This will minimize power usage

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Adafruit_ESP32_Arduino_Demos/ESP32_sleeptest/ESP32_sleeptest.ino

The best way to really test power draw is with a specialty power meter such as the Nordic PPK 2

### Nordic nRF-PPK2 - Power Profiler Kit II

[Nordic nRF-PPK2 - Power Profiler Kit II](https://www.adafruit.com/product/5048)
The **Power Profiler Kit II** &nbsp;is a standalone unit, which can measure and optionally supply currents all the way from sub-uA and as high as 1A on all Nordic DKs, in addition to external hardware. [As we've featured on...](https://www.youtube.com/watch?v=60q8QCiYhjc)

In Stock
[Buy Now](https://www.adafruit.com/product/5048)
[Related Guides to the Product](https://learn.adafruit.com/products/5048/guides)
![Angled shot of Nordic nrF Power Profiler board.](https://cdn-shop.adafruit.com/640x480/5048-00.jpg)

When running the above code and monitoring with a PPK, you'll get a graph like this:

![](https://cdn-learn.adafruit.com/assets/assets/000/109/375/medium800/low_power_esp32_qtpy_esp32pico_sleepcycle.png?1645930315)

The big pulse is normal mode, you can see the ESP32 booting up, loading code, and then pausing 1 second. Then there's a big drop for one sec to light sleep, and finally one more 1 second pause at deep sleep.

## Power Draw for ESP32-C6 Feather

The following graphs show the power draw for the ESP32-C6 Feather V2 in normal power mode, light sleep mode, and deep sleep mode.

### Normal Power Mode
![](https://cdn-learn.adafruit.com/assets/assets/000/132/008/medium800/adafruit_products_ppkNormal.png?1724431523)

The power draw, running normally (without WiFi), is 33.4mA.

### Light Sleep Mode
![](https://cdn-learn.adafruit.com/assets/assets/000/131/984/medium800/adafruit_products_ppkLight.png?1724341874)

The power draw in light sleep mode is 353.17uA.

### Deep Sleep Mode
![](https://cdn-learn.adafruit.com/assets/assets/000/131/985/medium800/adafruit_products_ppkDeep.png?1724341901)

The power draw in deep sleep mode is 72.15uA.

# Adafruit ESP32-C6 Feather

## Power Management

![](https://cdn-learn.adafruit.com/assets/assets/000/132/007/medium800/adafruit_products_Feather-ESP32-C6-Battery.jpg?1724430180)

# Battery + USB Power

We wanted to make our Feather boards easy to power both when connected to a computer as well as via battery.

There's **two ways to power** a Feather:

1. You can connect with a USB cable (just plug into the jack) and the Feather will regulate the 5V USB down to 3.3V.
2. You can also connect a 4.2/3.7V Lithium Polymer (LiPo/LiPoly) or Lithium Ion (LiIon) battery to the JST jack. This will let the Feather run on a rechargeable battery.

**When the USB power is powered, it will automatically switch over to USB for power, as well as start charging the battery (if attached).** This happens 'hot-swap' style so you can always keep the LiPoly connected as a 'backup' power that will only get used when USB power is lost.

Danger: 

![](https://cdn-learn.adafruit.com/assets/assets/000/131/978/medium800/adafruit_products_powerManage.jpg?1724338677)

The above shows the USB C jack (left), LiPoly JST jack (top left), as well as the 3.3V regulator and changeover diode (just to the right of the JST jack) and the LiPoly charging circuitry (above the Reset button).&nbsp;

There's also a **CHG** LED next to the USB jack, which will light up while the battery is charging. This LED might also flicker if the battery is not connected, it's normal.

Info: 

# Power Supplies

You have a lot of power supply options here! We bring out the **BAT** pin, which is tied to the LiPoly JST connector, as well as **USB** which is the +5V from USB if connected. We also have the **3V** pin which has the output from the 3.3V regulator. We use a 500mA peak regulator. While you can get 500mA from it, you can't do it continuously from 5V as it will overheat the regulator.

![](https://cdn-learn.adafruit.com/assets/assets/000/131/979/medium800/adafruit_products_powerManagePins.jpg?1724338876)

# Measuring Battery

If you're running off of a battery, chances are you wanna know what the voltage is at! That way you can tell when the battery needs recharging. LiPoly batteries are 'maxed out' at 4.2V and stick around 3.7V for much of the battery life, then slowly sink down to 3.2V or so before the protection circuitry cuts it off. By measuring the voltage you can quickly tell when you're heading below 3.7V.

This board includes an&nbsp; **MAX17048 Battery Monitor**** &nbsp;**that reports the voltage and charge percent over I2C.

The MAX17048 battery monitor is available over I2C on address&nbsp; **0x36**.

Our&nbsp;[Arduino MAX1704x](https://github.com/adafruit/Adafruit_MAX1704x)&nbsp;or&nbsp;[CircuitPython/Python MAX1704x](https://github.com/adafruit/Adafruit_CircuitPython_MAX1704x)&nbsp;library code allows you to read the voltage and percentage whenever you like.&nbsp;

There is no pin on this board that returns battery voltage, but this I2C monitor makes it super simple to get that data!

![](https://cdn-learn.adafruit.com/assets/assets/000/131/980/medium800/adafruit_products_max.jpg?1724339121)

In Arduino, you can measure the battery voltage using the following script.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/MAX17048_and_LC709203F_Battery_Monitor_Test/MAX17048_and_LC709203F_Battery_Monitor_Test.ino

For CircuitPython, you can measure it like this.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/CircuitPython_Templates/power_management_measuring_battery/code.py

# ENable pin

If you'd like to turn off the 3.3V regulator, you can do that with the **EN** (able) pin. Simply tie this pin to **Ground** and it will disable the 3V regulator. The **BAT** and **USB** pins will still be powered.

![](https://cdn-learn.adafruit.com/assets/assets/000/131/981/medium800/adafruit_products_enable.jpg?1724339212)

# STEMMA QT and NeoPixel Power

The ESP32-C6 Feather is equipped with&nbsp;a STEMMA QT port and NeoPixel which are both connected to their own regulator. Unlike the one controlled by the ENable pin, this is controlled by GPIO. They are enabled by default in CircuitPython and Arduino. You can disable it manually for low power usage. This pin is available in CircuitPython as&nbsp;`I2C_POWER` and in Arduino as&nbsp;`I2C_NEOPIXEL_POWER`.

Warning: If you run into I2C or NeoPixel power issues on Arduino, ensure you are using the latest Espressif board support package. If you are still having issues, you may need to manually pull the pin high in your code.

![](https://cdn-learn.adafruit.com/assets/assets/000/131/982/medium800/adafruit_products_qt_neoPower.jpg?1724339410)

# Alternative Power Options

The two primary ways for powering a feather are a 3.7/4.2V LiPo battery plugged into the JST port _or_ a USB power cable.

If you need other ways to power the Feather, here's what we recommend:

- For permanent installations, a [5V 1A USB wall adapter](https://www.adafruit.com/product/501) will let you plug in a USB cable for reliable power
- For mobile use, where you don't want a LiPoly, [use a USB battery pack!](https://www.adafruit.com/product/1959)
- If you have a higher voltage power supply, [use a 5V buck converter](https://www.adafruit.com/?q=5V%20buck) and wire it to a [USB cable's 5V and GND input](https://www.adafruit.com/product/3972)

Here's what you cannot do:

- **Do not use alkaline or NiMH batteries** and connect to the battery port - this will destroy the LiPoly charger
- **Do not use 7.4V RC batteries on the battery port** - this will destroy the board

The Feather _is not designed for external power supplies_ - this is a design decision to make the board compact and low cost. It is not recommended, but technically possible:

- **Connect an external 3.3V power supply to the 3V and GND pins.** Not recommended, this may cause unexpected behavior and the **EN** pin will no longer work. Also this doesn't provide power on **BAT** or **USB** and some Feathers/Wings use those pins for high current usages. You may end up damaging your Feather.
- **Connect an external 5V power supply to the USB and GND pins.** Not recommended, this may cause unexpected behavior when plugging in the USB port because you will be back-powering the USB port, which _could_ confuse or damage your computer.

![](https://cdn-learn.adafruit.com/assets/assets/000/132/010/medium800/adafruit_products_chargeDisable.jpg?1724432549)

If you use&nbsp; **alkaline or NiMH batteries** &nbsp;and connect to the battery port, you'll destroy the LiPoly charger, _ **unless** _ you cut the **Charger Disable jumper**. This jumper is located on the back of the board. If you cut it, the LiPoly charger will be disabled and allow you to use alkaline or NiMH batteries.&nbsp;

# Adafruit ESP32-C6 Feather

## Install CircuitPython

[CircuitPython](https://github.com/adafruit/circuitpython) is a derivative of [MicroPython](https://micropython.org) designed to simplify experimentation and education on low-cost microcontrollers. It makes it easier than ever to get prototyping by requiring no upfront desktop software downloads. ESP32 CircuitPython firmware is uploaded to the board via the USB serial port.

Follow this step-by-step to get CircuitPython running on your board.

## CircuitPython Download
Currently we recommend users use an absolute newest version of CircuitPython with the ESP32-C6 Feather. To download this **.BIN** file, click the button below.

[adafruit_feather_esp32c6_4mbflash_nopsram BIN](https://cdn-learn.adafruit.com/assets/assets/000/132/011/original/adafruit_feather_esp32c6_4mbflash_nopsram_%281%29.zip?1724432777)
 **Click the link above to download the latest CircuitPython .bin file.**

Save it wherever is convenient for you.

![install_circuitpython_on_esp32_ESP32_CircuitPython_bin_downloaded.png](https://cdn-learn.adafruit.com/assets/assets/000/114/559/medium640/install_circuitpython_on_esp32_ESP32_CircuitPython_bin_downloaded.png?1661800263)

## Bootloader Mode
Before connecting to the Web Flasher, you need to put the board into bootloader mode. To do this, hold down the **Boot** button (highlighted in blue). While continuing to hold down the **Boot** button, press and release the **Reset** button (highlighted in green). Then, release the&nbsp; **Boot** button. Your board is now in bootloader mode.

![](https://cdn-learn.adafruit.com/assets/assets/000/132/016/medium800/adafruit_products_resetBoot.jpg?1724698919)

## Connecting to the Web Flasher

To begin, **plug your board into your computer via USB, using**  **a known-good data-sync cable** , directly, or via an adapter if needed.

**You will have to use the Chrome or a Chromium-based browser to install CircuitPython.** [For example, Edge and Opera are Chromium based](https://en.wikipedia.org/wiki/Chromium_(web_browser)).

Safari and Firefox, etc are _not_ supported - [they have not implemented Web Serial](https://developer.mozilla.org/en-US/docs/Web/API/Serial#browser_compatibility)!

In the **Chrome browser** visit [https://adafruit.github.io/Adafruit\_WebSerial\_ESPTool/](https://adafruit.github.io/Adafruit_WebSerial_ESPTool/)

The main page of the ESP Web Flasher should look something like this.

Note: The site now displays an alert that it is no longer maintained, and suggests using a different option. The ESP Web Flasher has still proven to be more consistent and easier to use, so it is highly suggested that you continue with this version.

![install_circuitpython_on_esp32_with_boot_button_ESPCP_web_flasher_main_page.png](https://cdn-learn.adafruit.com/assets/assets/000/114/594/medium640/install_circuitpython_on_esp32_with_boot_button_ESPCP_web_flasher_main_page.png?1661892930)

 **You should remove all other USB devices so**  **_only_ the target board is attached.** This eliminates confusion over multiple ports!

Press the&nbsp; **Connect** button in the top right of the web browser. You will get a pop up asking you to select the COM or Serial port. Look for **USB Single Serial**.

On some systems, such as MacOS, there may be additional system ports that appear in the list (as shown in the image).

![install_circuitpython_on_esp32_with_boot_button_ESPCP_connect_and_ports.png](https://cdn-learn.adafruit.com/assets/assets/000/114/595/medium640/install_circuitpython_on_esp32_with_boot_button_ESPCP_connect_and_ports.png?1661893121)

The Javascript code will now try to connect to the board. It may timeout for a bit until it succeeds. On success, you will see that it is **Connected** &nbsp;and will print out a unique&nbsp; **MAC address** identifying the board along with other information that was detected.

![install_circuitpython_on_esp32_with_boot_button_ESPCP_flasher_connection_success.png](https://cdn-learn.adafruit.com/assets/assets/000/114/596/medium640/install_circuitpython_on_esp32_with_boot_button_ESPCP_flasher_connection_success.png?1661893862)

Once you have successfully connected, the command toolbar will appear.

![install_circuitpython_on_esp32_with_boot_button_ESPCP_command_tool_bar.png](https://cdn-learn.adafruit.com/assets/assets/000/114/597/medium640/install_circuitpython_on_esp32_with_boot_button_ESPCP_command_tool_bar.png?1661893964)

## Erasing the Board Contents

If you would like to erase the entire flash area so that you can start with a clean slate, you can use the erase feature. We recommend doing this every time before installing or updating CircuitPython.

To erase the contents, click the **Erase** button. You will be prompted as to whether you want to continue. Click **OK** to continue. If you do not wish to continue, click Cancel.

![install_circuitpython_on_esp32_ESPCP_click_erase_ok.png](https://cdn-learn.adafruit.com/assets/assets/000/114/630/medium640/install_circuitpython_on_esp32_ESPCP_click_erase_ok.png?1661976027)

You'll see "Erasing flash memory. Please wait..." This will eventually be followed by "Finished." and the amount of time it took to erase.

**Do not disconnect!** Immediately continue on to Programming the Board.

![install_circuitpython_on_esp32_ESPCP_erase_finished.png](https://cdn-learn.adafruit.com/assets/assets/000/114/632/medium640/install_circuitpython_on_esp32_ESPCP_erase_finished.png?1661976226)

Warning: 

## Programming the Board
You can click on **Choose a file...** from any of the available buttons. It will only attempt to program buttons with a file and a unique location. Select the&nbsp; **.bin** file you downloaded at the beginning of this page from the file chooser dialogue.

Verify that the **Offset** box next to the file location you used is 0x0. The offset defaults to 0x0, so unless you changed it manually, it should be good to go.

![install_circuitpython_on_esp32_ESPCP_choose_a_file.png](https://cdn-learn.adafruit.com/assets/assets/000/114/633/medium640/install_circuitpython_on_esp32_ESPCP_choose_a_file.png?1661976639)

![install_circuitpython_on_esp32_ESPCP_bin_to_upload.png](https://cdn-learn.adafruit.com/assets/assets/000/114/669/medium640/install_circuitpython_on_esp32_ESPCP_bin_to_upload.png?1661979129)

Once you choose a file, the button text will change to match your filename. You can then click the **Program** button to start flashing.

![install_circuitpython_on_esp32_ESPCP_bin_loaded_press_program.png](https://cdn-learn.adafruit.com/assets/assets/000/114/655/medium640/install_circuitpython_on_esp32_ESPCP_bin_loaded_press_program.png?1661978037)

A progress bar will appear and after a minute or two, you will have written the firmware.

![install_circuitpython_on_esp32_ESPCP_programming_the_bin.png](https://cdn-learn.adafruit.com/assets/assets/000/114/656/medium640/install_circuitpython_on_esp32_ESPCP_programming_the_bin.png?1661978267)

You've now successfully programmed CircuitPython onto your board! As suggested in the output, press reset to run the new firmware.

![install_circuitpython_on_esp32_ESPCP_programming_complete.png](https://cdn-learn.adafruit.com/assets/assets/000/114/668/medium640/install_circuitpython_on_esp32_ESPCP_programming_complete.png?1661978790)

As the ESP32-C6 does not have native USB, no USB drive will show up on your computer when you reset. With CircuitPython firmware loaded, the REPL can be accessed over a serial/COM port.

Don't worry though! We have the [CircuitPython USB Workflow Code Editor](https://learn.adafruit.com/circuitpython-usb-workflow-code-editor-quick-start) so that you can access the board via USB in your Chromium-based browser.

# Adafruit ESP32-C6 Feather

## Connecting to the USB Workflow Code Editor

Warning: The USB workflow is a new feature and there may be bugs! If you find a bug, please [file an issue on GitHub](https://github.com/circuitpython/web-editor/issues).

To use the Code Editor, you will need an internet browser such as Google Chrome or Microsoft Edge. It's possible that it may work in other browsers as well, but these have been more thoroughly tested.

Open your browser and navigate to [https://code.circuitpython.org/](https://code.circuitpython.org/). Select **USB** on the dialog prompt that comes up.

![circuitpython_Screenshot_2024-07-01_at_10.27.14_AM.png](https://cdn-learn.adafruit.com/assets/assets/000/130/966/medium640/circuitpython_Screenshot_2024-07-01_at_10.27.14_AM.png?1719854918)

This will display a page of instructions along with a **button** to bring up a list of devices to connect to.

Click **Connect to Device** and then **select your board** in the pop-up window. Click **Connect** to connect your board to the editor.

![circuitpython_Screenshot_2024-07-01_at_10.29.39_AM.png](https://cdn-learn.adafruit.com/assets/assets/000/130/967/medium640/circuitpython_Screenshot_2024-07-01_at_10.29.39_AM.png?1719855227)

![circuitpython_Screenshot_2024-07-01_at_10.38.48_AM.png](https://cdn-learn.adafruit.com/assets/assets/000/130/970/medium640/circuitpython_Screenshot_2024-07-01_at_10.38.48_AM.png?1719855548)

Once you have connected, the **Connect** button in the upper right-hand corner should change to a **Disconnect** button.

![wireless_Disconnect_Button.png](https://cdn-learn.adafruit.com/assets/assets/000/114/892/medium640/wireless_Disconnect_Button.png?1662672956)

# Adafruit ESP32-C6 Feather

## Navigating USB Workflow

## Opening and Saving Files

Opening and Saving files is designed to be like to most other applications.&nbsp;Just use the buttons along the top of the editor window.

Clicking the **Open** or&nbsp; **Save As** buttons along the top will open the File Dialog. Clicking the **Save + Run** button will save your file and run the code. If your file hasn't been saved yet, this will also bring up the file dialog box.

![wireless_Screenshot_2024-07-02_at_8.46.57_AM.png](https://cdn-learn.adafruit.com/assets/assets/000/130/980/medium640/wireless_Screenshot_2024-07-02_at_8.46.57_AM.png?1719935356)

The file dialog that appears is a simplified dialog that displays the current path at the top, allows you to navigate through the file tree to select the file you would like to open, and has buttons on the bottom to open or save the file you would like to use.

Canceling will tell the editor that you do not want to continue with the current operation.

![wireless_File_dialog.png](https://cdn-learn.adafruit.com/assets/assets/000/115/953/medium640/wireless_File_dialog.png?1666046715)

The X at the top performs the same function as the Cancel button as does clicking outside of the dialog.

On the Save As dialog, you can also type in a filename in the field next to the button.

![wireless_File_dialog_2.png](https://cdn-learn.adafruit.com/assets/assets/000/115/954/medium640/wireless_File_dialog_2.png?1666046738)

## Running Code

As mentioned above, the&nbsp; **Save + Run** button will first save your file, then run the code. The logic to run the code however is currently very simplistic in that it will try a couple of basic strategies to run your code, but doesn't currently do much beyond that.

The way it works is if you are working on **code.py** in the root folder, a soft reset will be performed, which automatically runs **code.py**. If you were working on some code in another file, the editor will attempt to perform an import on this code, which should run it. When you run your code, it will automatically switch over to the serial terminal.

Click the **Save + Run** &nbsp;button to save and run the code current code.

![wireless_Save_and_Run.png](https://cdn-learn.adafruit.com/assets/assets/000/114/853/medium640/wireless_Save_and_Run.png?1662509114)

## File Dialog Toolbar

The file Dialog toolbar along the top allows you to perform common operations on files and folders regardless of whether you are saving or opening. Clicking the cancel button at the bottom will not undo any operations that were performed with these buttons.

### Renaming and Deleting Files and Folders

You can rename or delete both files and folders. An item must be selected first for the buttons to become available.

Use the **delete** and **rename** buttons here to perform the corresponding operation on the currently selected file or folder.

![wireless_Delete_and_Rename.png](https://cdn-learn.adafruit.com/assets/assets/000/115/955/medium640/wireless_Delete_and_Rename.png?1666047250)

### Creating New Folders

This feature allows you to create a new folder to store your work inside of.

Clicking the **new folder** button at the top will prompt you for a folder name. It will inform you of invalid folder names such as the same name as an existing file or folder or a folder that begins with a period.

![wireless_New_Folder.png](https://cdn-learn.adafruit.com/assets/assets/000/115/956/medium640/wireless_New_Folder.png?1666047276)

![wireless_New_Folder_Prompt.png](https://cdn-learn.adafruit.com/assets/assets/000/115/957/medium640/wireless_New_Folder_Prompt.png?1666047296)

### Uploading and Downloading Files and Folders

This feature allows you to upload or download files as long as they fit in the available space. If you need to add images or sound files for your project, you can use the upload button to add them. If you need to retrieve a file from your device for whatever reason, the download button will give you access to do that.

You can also download folders. When you select a folder and click download, the contents of that folder are automatically zipped into a single file. If nothing is selected when you click the download button, the current folder will be used.

Use the **upload** or **download** buttons to easily add files or retrieve them from your board.

![wireless_Upload_and_Download.png](https://cdn-learn.adafruit.com/assets/assets/000/115/958/medium640/wireless_Upload_and_Download.png?1666047325)

### Moving Files and Folders

This feature allows you to move files and folders to a different location on the device. When you click the move button, another prompt will appear on top of the dialog that allows you to navigate to where you would like to move the currently selected item.&nbsp;

Use the **move** button to move files or folders to a new location on the device.

The second dialog that appears will show only folders and allow you to navigate to where you would like to move the file.

![wireless_Move_Item.png](https://cdn-learn.adafruit.com/assets/assets/000/115/959/medium640/wireless_Move_Item.png?1666047519)

![wireless_Move_Item_Prompt.png](https://cdn-learn.adafruit.com/assets/assets/000/115/960/medium640/wireless_Move_Item_Prompt.png?1666047536)

## Using the Serial Terminal
The serial terminal allows you to watch the output of your device as well as type inputs just like you can from a separate application like PuTTY, except there's nothing you need to configure. This allows you to access the REPL or view the output of your currently running code.

Use the mode buttons in the bottom left-hand corner to open and close the serial and editor panes.

![wireless_Screenshot_2024-07-03_at_8.08.00_AM.png](https://cdn-learn.adafruit.com/assets/assets/000/131/075/medium640/wireless_Screenshot_2024-07-03_at_8.08.00_AM.png?1720019348)

## More Features to Come

The CircuitPython Code Editor is still under development, so expect more features to be added. If you would like to contribute [on GitHub](https://github.com/circuitpython/web-editor/), you can submit any new issues or pull requests for review.

# Adafruit ESP32-C6 Feather

## Blink

In learning any programming language, you often begin with some sort of `Hello, World!` program. In CircuitPython, Hello, World! is blinking an LED. Blink is one of the simplest programs in CircuitPython. It involves three built-in modules, two lines of set up, and a short loop. Despite its simplicity, it shows you many of the basic concepts needed for most CircuitPython programs, and provides a solid basis for more complex projects. Time to get blinky!

## LED Location
The LED is located between the USB C port and the mounting hole.

![](https://cdn-learn.adafruit.com/assets/assets/000/131/898/medium800/adafruit_products_ledOutline.jpg?1724078126)

## Blinking an LED

In the example below, click the **Download Project Bundle** button below to download the necessary libraries and the **code.py** file in a zip file. Extract the contents of the zip file, open the directory **CircuitPython\_Templates/blink/** and then click on the directory that matches the version of CircuitPython you're using.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/CircuitPython_Templates/blink/code.py

In the editor window in your browser, click the **Open** button to view the file dialog. Then, click the **Upload** button and select **Upload Files**.

![blink_upload.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/893/medium640/blink_upload.jpg?1724077429)

Navigate to the project bundle that you downloaded and select the **code.py** file.

![blink_code_dot_py.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/894/medium640/blink_code_dot_py.jpg?1724077767)

You'll be asked if you want to overwrite the previous **code.py** with the new **code.py** file from the Project Bundle. Click **OK**.

![blink_overwrite.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/895/medium640/blink_overwrite.jpg?1724077804)

You'll see a new **code.py** file appear in the file browser. **Select it** and click **Open** to view it in the code editor.

![blink_openCode.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/896/medium640/blink_openCode.jpg?1724077840)

You'll see the LED blink **code.py** file contents. Click **Restart** above the Serial monitor to run the LED blink code.

![](https://cdn-learn.adafruit.com/assets/assets/000/131/897/medium800/blink_restartCode.jpg?1724077902)

The built-in LED begins blinking!

Note that the code is a little less "Pythonic" than it could be. It could also be written as `led.value = not led.value` with a single `time.sleep(0.5)`. That way is more difficult to understand if you're new to programming, so the example is a bit longer than it needed to be to make it easier to read.

It's important to understand what is going on in this program.

First you `import` three modules: `time`, `board` and `digitalio`. This makes these modules available for use in your code. All three are built-in to CircuitPython, so you don't need to download anything to get started.

Next, you set up the LED. To interact with hardware in CircuitPython, your code must let the board know where to look for the hardware and what to do with it. So, you create a `digitalio.DigitalInOut()` object, provide it the LED pin using the `board` module, and save it to the variable `led`. Then, you tell the pin to act as an `OUTPUT`.

Finally, you create a `while True:` loop. This means all the code inside the loop will repeat indefinitely. Inside the loop, you set `led.value = True` which powers on the LED. Then, you use `time.sleep(0.5)` to tell the code to wait half a second before moving on to the next line. The next line sets `led.value = False` which turns the LED off. Then you use another `time.sleep(0.5)` to wait half a second before starting the loop over again.

With only a small update, you can control the blink speed. The blink speed is controlled by the amount of time you tell the code to wait before moving on using `time.sleep()`. The example uses `0.5`, which is one half of one second. Try increasing or decreasing these values to see how the blinking changes.

That's all there is to blinking an LED using CircuitPython!

# Adafruit ESP32-C6 Feather

## Digital Input

The CircuitPython `digitalio` module has many applications. The basic Blink program sets up the LED as a digital output. You can just as easily set up a **digital input** such as a button to control the LED. This example builds on the basic Blink example, but now includes setup for a button switch. Instead of using the `time` module to blink the LED, it uses the status of the button switch to control whether the LED is turned on or off.

## LED and Button
![](https://cdn-learn.adafruit.com/assets/assets/000/131/904/medium800/adafruit_products_led_button.jpg?1724078998)

## Controlling the LED with a Button

In the example below, click the **Download Project Bundle** button below to download the necessary libraries and the **code.py** file in a zip file. Extract the contents of the zip file, open the directory **CircuitPython\_Templates/digital\_input\_built\_in\_button\_led/** and then click on the directory that matches the version of CircuitPython you're using.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/CircuitPython_Templates/digital_input_built_in_button_led/code.py

In the editor window in your browser, click the **Open** button to view the file dialog. Then, click the **Upload** button and select **Upload Files**.

![digital_input___little_led_and_button_upload.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/899/medium640/digital_input___little_led_and_button_upload.jpg?1724078447)

Navigate to the project bundle that you downloaded and select the **code.py** file.

![digital_input___little_led_and_button_code_dot_py.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/900/medium640/digital_input___little_led_and_button_code_dot_py.jpg?1724078473)

You'll be asked if you want to overwrite the previous **code.py** with the new **code.py** file from the Project Bundle. Click **OK**.

![digital_input___little_led_and_button_overwrite.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/901/medium640/digital_input___little_led_and_button_overwrite.jpg?1724078490)

You'll see a new **code.py** file appear in the file browser. **Select it** and click **Open** to view it in the code editor.

![digital_input___little_led_and_button_openCode.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/902/medium640/digital_input___little_led_and_button_openCode.jpg?1724078507)

You'll see the digital input **code.py** file contents. Click **Restart** above the Serial monitor to run the digital input code.

![](https://cdn-learn.adafruit.com/assets/assets/000/131/903/medium800/digital_input___little_led_and_button_digiRestart.jpg?1724078690)

Now, press the button. The LED lights up! Let go of the button and the LED turns off.

![](https://cdn-learn.adafruit.com/assets/assets/000/132/001/medium800thumb/adafruit_products_button.jpg?1724429420)

Note that the code is a little less "Pythonic" than it could be. It could also be written as `led.value = not button.value`. That way is more difficult to understand if you're new to programming, so the example is a bit longer than it needed to be to make it easier to read.

First you `import` two modules: `board` and `digitalio`. This makes these modules available for use in your code. Both are built-in to CircuitPython, so you don't need to download anything to get started.

Next, you set up the LED. To interact with hardware in CircuitPython, your code must let the board know where to look for the hardware and what to do with it. So, you create a `digitalio.DigitalInOut()` object, provide it the LED pin using the `board` module, and save it to the variable `led`. Then, you tell the pin to act as an `OUTPUT`.

You include setup for the button as well. It is similar to the LED setup, except the button is an `INPUT`, and requires a pull up.

Inside the loop, you check to see if the button is pressed, and if so, turn on the LED. Otherwise the LED is off.

That's all there is to controlling an LED with a button switch!

# Adafruit ESP32-C6 Feather

## I2C Scan

![](https://cdn-learn.adafruit.com/assets/assets/000/114/225/medium800/i2c_I2C_controller_target.jpg?1660678571 A QT Py ESP32-S2 connected to an MCP9808 Temperature Sensor for I2C via STEMMA QT.)

The **I2C** , or [inter-integrated circuit](https://en.wikipedia.org/wiki/I%C2%B2C), is a 2-wire protocol for communicating with simple sensors and devices, which means it uses two connections, or wires, for transmitting and receiving data. One connection is a clock, called **SCL**. The other is the data line, called **SDA**. Each pair of clock and data pins are referred to as a **bus**.

Typically, there is a device that acts as a **controller** and sends requests to the **target** devices on each bus. In this case, your microcontroller board acts as the controller, and the sensor breakout acts as the target. Historically, the controller is referred to as the master, and the target is referred to as the slave, so you may run into that terminology elsewhere. The official terminology is [controller and target](https://adafruit.com/controller-peripheral).

**Multiple I2C devices can be connected to the same clock and data lines.** Each I2C device has an address, and as long as the addresses are different, you can connect them at the same time. This means you can have many different sensors and devices all connected to the same two pins.

**Both I2C connections require pull-up resistors** , and most Adafruit I2C sensors and breakouts have pull-up resistors built in. If you're using one that does not, you'll need to add your own 2.2-10kΩ pull-up resistors from SCL and SDA to 3.3V.

## I2C and CircuitPython

CircuitPython supports many I2C devices, and makes it super simple to interact with them. There are libraries available for many I2C devices in the [CircuitPython Library Bundle](https://circuitpython.readthedocs.io/projects/bundle/en/latest/#table-of-contents). (If you don't see the sensor you're looking for, keep checking back, more are being written all the time!)

In this section, you'll learn how to scan the I2C bus for all connected devices. Then you'll learn how to interact with an I2C device.

## Necessary Hardware

You'll need the following additional hardware to complete the examples on this page.

### Adafruit MCP9808 High Accuracy I2C Temperature Sensor Breakout

[Adafruit MCP9808 High Accuracy I2C Temperature Sensor Breakout](https://www.adafruit.com/product/5027)
The MCP9808 digital temperature sensor is one of the more accurate/precise we've ever seen, with a typical accuracy of ±0.25°C over the sensor's -40°C to +125°C range and precision of +0.0625°C. They work great with any microcontroller using standard I2C. With...

Out of Stock
[Buy Now](https://www.adafruit.com/product/5027)
[Related Guides to the Product](https://learn.adafruit.com/products/5027/guides)
![Top view of temperature sensor breakout above an OLED display FeatherWing. The OLED display reads "MCP9808 Temp: 24.19ºC"](https://cdn-shop.adafruit.com/640x480/5027-04.jpg)

### STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long

[STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long](https://www.adafruit.com/product/4399)
This 4-wire cable is&nbsp;50mm / 1.9" long and fitted with JST SH female 4-pin connectors on both ends. Compared with the chunkier JST PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4399)
[Related Guides to the Product](https://learn.adafruit.com/products/4399/guides)
![Angled of of JST SH 4-Pin Cable.](https://cdn-shop.adafruit.com/640x480/4399-00.jpg)

While the examples here will be using the [Adafruit MCP9808](https://www.adafruit.com/product/5027), a high accuracy temperature sensor, the overall process is the same for just about any I2C sensor or device.

The first thing you'll want to do is get the sensor connected so your board has I2C to talk to.

## Wiring the MCP9808

The MCP9808 comes with a STEMMA QT connector, which makes wiring it up quite simple and solder-free.

Connect the STEMMA QT cable from&nbsp; **the STEMMA QT port on your board** &nbsp;to&nbsp; **the STEMMA QT port on the MCP9808**.

![adafruit_products_i2cScan_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/999/medium640/adafruit_products_i2cScan_bb.jpg?1724428077)

## Find Your Sensor

The first thing you'll want to do after getting the sensor wired up, is make sure it's wired correctly. You're going to do an I2C scan to see if the board is detected, and if it is, print out its I2C address.

In the example below, click the **Download Project Bundle** button below to download the necessary libraries and the **code.py** file in a zip file. Extract the contents of the zip file, open the directory **CircuitPython\_Templates/i2c\_scan/** and then click on the directory that matches the version of CircuitPython you're using.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/CircuitPython_Templates/i2c_scan/code.py

In the editor window in your browser, click the **Open** button to view the file dialog. Then, click the **Upload** button and select **Upload Files**.

![i2c_upload.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/905/medium640/i2c_upload.jpg?1724080096)

Navigate to the project bundle that you downloaded and select the **code.py** file.

![i2c_code_dot_py.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/906/medium640/i2c_code_dot_py.jpg?1724080113)

You'll be asked if you want to overwrite the previous **code.py** with the new **code.py** file from the Project Bundle. Click **OK**.

![i2c_overwrite.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/907/medium640/i2c_overwrite.jpg?1724080129)

You'll see a new **code.py** file appear in the file browser. **Select it** and click **Open** to view it in the code editor.

![i2c_openCode.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/908/medium640/i2c_openCode.jpg?1724080143)

The Feather ESP32-C6 comes with 1 I2C sensor built in: the MAX17048. The I2C scan code will show the address from the built in sensor ( **0x36** ) and the MCP9808 ( **0x18** ).

Info: ESP32-C6 Feather comes with an I2C sensor built in: the MAX17048. The I2C scan code will show the addresses from the built-in sensor and the MCP9808.

![](https://cdn-learn.adafruit.com/assets/assets/000/131/992/medium800/adafruit_products_Screenshot_2024-08-22_164316.png?1724359418)

If you run this and it seems to hang, try manually unlocking your I2C bus by running the following two commands from the REPL.

```terminal
import board
board.I2C().unlock()
```

First you create the `i2c` object, using `board.I2C()`. This convenience routine creates and saves a `busio.I2C` object using the default pins `board.SCL` and `board.SDA`. If the object has already been created, then the existing object is returned. No matter how many times you call `board.I2C()`, it will return the same object. This is called a _singleton_.

To be able to scan it, you need to lock the I2C down so the only thing accessing it is the code. So next you include a loop that waits until I2C is locked and then continues on to the scan function.

Last, you have the loop that runs the actual scan, `i2c_scan()`. Because I2C typically refers to addresses in hex form, the example includes this bit of code that formats the results into hex format: `[hex(device_address) for device_address in i2c.scan()]`.

Open the serial console to see the results! The code prints out an array of addresses. You've connected the MCP9808 which has a 7-bit I2C address of 0x18. The result for this sensor is `I2C addresses found: ['0x18']`. If no addresses are returned, refer back to the wiring diagrams to make sure you've wired up your sensor correctly.

# Adafruit ESP32-C6 Feather

## MAX17048 Battery Monitor

Your microcontroller board comes with an **MAX17048 lithium ion polymer (lipoly) battery monitor** built right onto the board. The MAX17048 is available over I2C.

The MAX17048 comes with its own Adafruit CircuitPython library that makes it simple to write code to read data from it. This example will be using, among other things, the [Adafruit CircuitPython MAX1704x](https://github.com/adafruit/Adafruit_CircuitPython_MAX1704x) library.

The example simply reads data from the battery monitor and prints it to the serial console. It is designed to show you how to get data from the battery monitor.

## MAX17048 Location
![](https://cdn-learn.adafruit.com/assets/assets/000/131/994/medium800/adafruit_products_maxRed.jpg?1724359739)

The&nbsp; **MAX17048 battery monitor** &nbsp;(highlighted in red) is immediately below the **USB** pin label. Its I2C address is&nbsp; **0x36**.

# MAX17048 Simple Data Example

To run this example, you need to first install the MAX1704x library into the **lib** folder on your board. Then you need to update **code.py** with the example script.

In the example below, click the&nbsp; **Download Project Bundle** button below to download the necessary libraries and the **code.py** file in a zip file. Extract the contents of the zip file.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/CircuitPython_Templates/max17048/code.py

## Update the **/lib** Folder
In the editor window in your browser, click the **Open** button to view the file dialog. Then, click the **Upload** button and select **Upload Folders**.

![i2c__onboard_max17048_uploadFolders.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/933/medium640/i2c__onboard_max17048_uploadFolders.jpg?1724156087)

Navigate to the project bundle that you downloaded and select the **/lib folder**.

![i2c__onboard_max17048_uploadLib.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/934/medium640/i2c__onboard_max17048_uploadLib.jpg?1724156384)

You'll be asked if you want to upload the **/lib** folder from the&nbsp;Project Bundle. Click **Upload**.

![i2c__onboard_max17048_uploadMax.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/935/medium640/i2c__onboard_max17048_uploadMax.jpg?1724156433)

After the upload finishes, you can open the **lib** folder to view the library files required for the MAX17048 example.

![i2c__onboard_max17048_maxLibFiles.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/936/medium640/i2c__onboard_max17048_maxLibFiles.jpg?1724156507)

## Update **code.py**
In the editor window in your browser, click the **Open** button to view the file dialog. Then, click the **Upload** button and select **Upload Files**.

![i2c__onboard_max17048_upload.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/937/medium640/i2c__onboard_max17048_upload.jpg?1724156558)

Navigate to the project bundle that you downloaded and select the **code.py** file.

![i2c__onboard_max17048_code_dot_py.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/938/medium640/i2c__onboard_max17048_code_dot_py.jpg?1724156589)

You'll be asked if you want to overwrite the previous **code.py** with the new **code.py** file from the Project Bundle. Click **OK**.

![i2c__onboard_max17048_overwrite.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/939/medium640/i2c__onboard_max17048_overwrite.jpg?1724156618)

Info: 

Open the serial console to see the battery data printed out!

![](https://cdn-learn.adafruit.com/assets/assets/000/131/995/medium800/adafruit_products_Screenshot_2024-08-22_165640.png?1724360223)

That's all there is to reading the MAX17048 data using CircuitPython!

For more details, check out the guide for the [MAX17048](https://learn.adafruit.com/adafruit-max17048-lipoly-liion-fuel-gauge-and-battery-monitor/python-circuitpython).

# Adafruit ESP32-C6 Feather

## NeoPixel

Your board has a built-in RGB NeoPixel status LED. You can use CircuitPython code to control the color and brightness of this LED. It is also used to indicate the bootloader status and errors in your CircuitPython code.

A NeoPixel is what Adafruit calls the WS281x family of addressable RGB LEDs. It contains three LEDs - a red one, a green one and a blue one - along side a driver chip in a tiny package controlled by a single pin. They can be used individually (as in the built-in LED on your board), or chained together in strips or other creative form factors. NeoPixels do not light up on their own; they require a microcontroller. So, it's super convenient that the NeoPixel is built in to your microcontroller board!

This page will cover using CircuitPython to control the status RGB NeoPixel built into your microcontroller. You'll learn how to change the color and brightness, and how to make a rainbow. Time to get started!

## NeoPixel Location
![](https://cdn-learn.adafruit.com/assets/assets/000/131/991/medium800/adafruit_products_neo.jpg?1724356312)

## NeoPixel Color and Brightness

To use with CircuitPython, you need to first install a few libraries, into the **lib** folder on your board. Then you need to update **code.py** with the example script.

In the example below, click the **Download Project Bundle** button below to download the necessary libraries and the **code.py** file in a zip file. Extract the contents of the zip file, open the directory **CircuitPython\_Templates/status\_led\_one\_neopixel\_rgb/** and then click on the directory that matches the version of CircuitPython you're using.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/CircuitPython_Templates/status_led_one_neopixel_rgb/code.py

## Update the **/lib** Folder
In the editor window in your browser, click the **Open** button to view the file dialog. Then, click the **Upload** button and select **Upload Folders**.

![built_in_neopixel_uploadFolders.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/912/medium640/built_in_neopixel_uploadFolders.jpg?1724082553)

Navigate to the project bundle that you downloaded and select the **/lib folder**.

![built_in_neopixel_uploadLib.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/913/medium640/built_in_neopixel_uploadLib.jpg?1724082575)

You'll be asked if you want to upload the **/lib** folder from the&nbsp;Project Bundle. Click **Upload**.

![built_in_neopixel_confirmUploadNeo.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/914/medium640/built_in_neopixel_confirmUploadNeo.jpg?1724082591)

After the upload finishes, you can open the **lib** folder to view the two library files required for the NeoPixel examples.

![built_in_neopixel_updatedLibNeo.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/915/medium640/built_in_neopixel_updatedLibNeo.jpg?1724082622)

## Update **code.py**
In the editor window in your browser, click the **Open** button to view the file dialog. Then, click the **Upload** button and select **Upload Files**.

![built_in_neopixel_upload.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/909/medium640/built_in_neopixel_upload.jpg?1724082434)

Navigate to the project bundle that you downloaded and select the **code.py** file.

![built_in_neopixel_code_dot_py.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/910/medium640/built_in_neopixel_code_dot_py.jpg?1724082449)

You'll be asked if you want to overwrite the previous **code.py** with the new **code.py** file from the Project Bundle. Click **OK**.

![built_in_neopixel_overwrite.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/911/medium640/built_in_neopixel_overwrite.jpg?1724082469)

The built-in NeoPixel begins blinking red, then green, then blue, and repeats!

![](https://cdn-learn.adafruit.com/assets/assets/000/132/004/medium800thumb/adafruit_products_rgb.jpg?1724430013)

First you import two modules, `time` and `board`, and one library, `neopixel`. This makes these modules and libraries available for use in your code. The first two are modules built-in to CircuitPython, so you don't need to download anything to use those. The `neopixel` library is separate, which is why you needed to install it before getting started.

Next, you set up the NeoPixel LED. To interact with hardware in CircuitPython, your code must let the board know where to look for the hardware and what to do with it. So, you create a `neopixel.NeoPixel()` object, provide it the NeoPixel LED pin using the `board` module, and tell it the number of LEDs. You save this object to the variable `pixel`.

Then, you set the NeoPixel brightness using the `brightness` attribute. `brightness` expects float between `0` and `1.0`. A _float_ is essentially a number with a decimal in it. The brightness value represents a percentage of maximum brightness; `0` is 0% and `1.0` is 100%. Therefore, setting `pixel.brightness = 0.3` sets the brightness to 30%. The default brightness, which is to say the brightness if you don't explicitly set it, is `1.0`. The default is really bright! That is why there is an option available to easily change the brightness.

Inside the loop, you turn the NeoPixel red for 0.5 seconds, green for 0.5 seconds, and blue for 0.5 seconds.

To turn the NeoPixel red, you "fill" it with an RGB value. Check out the section below for details on RGB colors. The RGB value for red is `(255, 0, 0)`. Note that the RGB value includes the parentheses. The `fill()` attribute expects the full RGB value including those parentheses. That is why there are two pairs of parentheses in the code.

You can change the RGB values to change the colors that the NeoPixel cycles through. Check out the list below for some examples. You can make any color of the rainbow with the right RGB value combination!

That's all there is to changing the color and setting the brightness of the built-in NeoPixel LED!

## RGB LED Colors

RGB LED colors are set using a combination of&nbsp; **r** ed, **g** reen, and **b** lue, in the form of an ( **R** ,&nbsp; **G** , **B** ) tuple. Each member of the tuple is set to a number between 0 and 255 that determines the amount of each color present. Red, green and blue in different combinations can create all the colors in the rainbow! So, for example, to set an LED to red, the tuple would be `(255, 0, 0)`, which has the maximum level of red, and no green or blue. Green would be `(0, 255, 0)`, etc. For the colors between, you set a combination, such as cyan which is `(0, 255, 255)`, with equal amounts of green and blue. If you increase all values to the same level, you get white! If you decrease all the values to 0, you turn the LED off.

Common colors include:

- red: `(255, 0, 0)`
- green: `(0, 255, 0)`
- blue: `(0, 0, 255)`
- cyan: `(0, 255, 255)`
- purple: `(255, 0, 255)`
- yellow: `(255, 255, 0)`
- white: `(255, 255, 255)`
- black (off): `(0, 0, 0)`

## NeoPixel Rainbow

You should have already installed the library necessary to use the built-in NeoPixel LED. If not, follow the steps at the beginning of the NeoPixel Color and Brightness section to install it.

In the example below, click the **Download Project Bundle** button below to download the necessary libraries and the **code.py** file in a zip file. Extract the contents of the zip file, open the directory **CircuitPython\_Templates/status\_led\_one\_neopixel\_rainbow/** and then click on the directory that matches the version of CircuitPython you're using.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/CircuitPython_Templates/status_led_one_neopixel_rainbow/code.py

Update the **code.py** file in the USB code editor with the rainbow **code.py** file. The same libraries from the RGB blinking example are used. The NeoPixel displays a rainbow cycle!

![](https://cdn-learn.adafruit.com/assets/assets/000/132/003/medium800thumb/adafruit_products_rainbow-1080.jpg?1724429915)

This example builds on the previous example.

First, you import the same three modules and libraries. In addition to those, you import `colorwheel`.

The NeoPixel hardware setup and brightness setting are the same.

Next, you have the `rainbow()` helper function. This helper displays the rainbow cycle. It expects a `delay` in seconds. The higher the number of seconds provided for `delay`, the slower the rainbow will cycle. The helper cycles through the values of the color wheel to create a rainbow of colors.

Inside the loop, you call the rainbow helper with a 0.2 second delay, by including `rainbow(0.2)`.

That's all there is to making rainbows using the built-in NeoPixel LED!

# Adafruit ESP32-C6 Feather

## WiFi Test

In this example, you'll test your ESP32-C6 Feather WiFi connection by connecting to your SSID, printing your MAC address and IP address to the REPL and then pinging Google.

## **settings.toml** File

If you've worked on WiFi projects with CircuitPython before, you're probably familiar with the **secrets.py** file. This file is a Python file that is stored on your **CIRCUITPY** drive that contains all of your secret WiFi information, such as your SSID, SSID password and any API keys for IoT services.&nbsp;

As of [CircuitPython 8](https://circuitpython.org/downloads), there is support for a **settings.toml** file. Similar to **secrets.py** , the **settings.toml** file separates your sensitive information from your main **code.py** file.

Warning: Your settings.toml file should be stored in the main directory of your board. It should not be in a folder.

## **settings.toml&nbsp;** File Example

Here is an example on how to format your&nbsp; **settings.toml** &nbsp;file.

```auto
# Comments are supported
CIRCUITPY_WIFI_SSID="guest wifi"
CIRCUITPY_WIFI_PASSWORD="guessable"
CIRCUITPY_WEB_API_PORT=80
CIRCUITPY_WEB_API_PASSWORD="passw0rd"
test_variable="this is a test"
thumbs_up="\U0001f44d"
```

In a&nbsp; **settings.toml** &nbsp;file, it's important to keep these factors in mind:

- Strings are wrapped in double quotes; ex:&nbsp;`"your-string-here"`
- Integers are&nbsp;_ **not** _&nbsp;quoted and may be written in decimal with optional sign (`+1`,&nbsp;`-1`,&nbsp;`1000`) or hexadecimal (`0xabcd`).
  - Floats, octal (`0o567`) and binary (`0b11011`) are not supported.

- Use&nbsp;`\u`&nbsp;escapes for weird characters,&nbsp;`\x`&nbsp;and&nbsp;`\ooo`&nbsp;escapes are not available in&nbsp; **.toml** &nbsp;files
  - Example:&nbsp;`\U0001f44d`&nbsp;for 👍 (thumbs up emoji) and&nbsp;`\u20ac`&nbsp;for € (EUR sign)

- Unicode emoji, and non-ASCII characters, stand for themselves as long as you're careful to save in "UTF-8 without BOM" format

When your&nbsp; **settings.toml&nbsp;** file is ready, you can save it in your text editor with the&nbsp; **.toml** &nbsp;extension.

![circuitpython_internet_test___settings_toml_adafruit_products_dotToml.jpg](https://cdn-learn.adafruit.com/assets/assets/000/122/208/medium640/circuitpython_internet_test___settings_toml_adafruit_products_dotToml.jpg?1688042031)

## CircuitPython WiFi Example
In the example below, click the **Download Project Bundle** button below to download the&nbsp; **code.py** file in a zip file. Extract the contents of the zip file and then click on the directory that matches the version of CircuitPython you're using.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Pico_W_CircuitPython_WiFi_Examples/Pico_W_Basic_WiFi_Test/code.py

In the editor window in your browser, click the **Open** button to view the file dialog. Then, click the **Upload** button and select **Upload Files**.

![circuitpython_internet_test___settings_toml_upload.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/916/medium640/circuitpython_internet_test___settings_toml_upload.jpg?1724083097)

Navigate to the project bundle that you downloaded and select the **code.py** file.

![circuitpython_internet_test___settings_toml_code_dot_py.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/917/medium640/circuitpython_internet_test___settings_toml_code_dot_py.jpg?1724083117)

You'll be asked if you want to overwrite the previous **code.py** with the new **code.py** file from the Project Bundle. Click **OK**.

![circuitpython_internet_test___settings_toml_overwrite.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/918/medium640/circuitpython_internet_test___settings_toml_overwrite.jpg?1724083133)

## Update Your **settings.toml** File

Remember to add your **settings.toml** file as described earlier in this page. You'll need to include your `CIRCUITPY_WIFI_SSID` and `CIRCUITPY_WIFI_PASSWORD` in the file.&nbsp;

You can edit the file manually in the USB code editor by clicking **Open** , selecting **settings.toml** and clicking **Open** at the bottom of the dialog box.

![circuitpython_internet_test___settings_toml_openSettingsDotToml.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/919/medium640/circuitpython_internet_test___settings_toml_openSettingsDotToml.jpg?1724083258)

With **settings.toml** open in the editor, you can add your WiFi credentials:

`CIRCUITPY_WIFI_SSID = "your-ssid-here"`  
`CIRCUITPY_WIFI_PASSWORD = "your-ssid-password-here"`

Once your credentials are entered, click **Save** above the editor to save your changes to **settings.toml**.

![circuitpython_internet_test___settings_toml_editSettingsDotToml.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/920/medium640/circuitpython_internet_test___settings_toml_editSettingsDotToml.jpg?1724083365)

Once everything is saved to the&nbsp;board, **Restart** the Serial Console to see the data printed out!

![](https://cdn-learn.adafruit.com/assets/assets/000/131/922/medium800/adafruit_products_Screenshot_2024-08-19_154504.png?1724096719)

## How the CircuitPython WiFi Example Works

In the basic WiFi test, the board connects to your SSID by importing your SSID and SSID password from the **settings.toml**** &nbsp;**file.

```python
wifi.radio.connect(os.getenv('CIRCUITPY_WIFI_SSID'), os.getenv('CIRCUITPY_WIFI_PASSWORD'))
```

Then, your MAC address and IP address are printed to the REPL.

```python
#  prints MAC address to REPL
print("My MAC addr:", [hex(i) for i in wifi.radio.mac_address])

#  prints IP address to REPL
print("My IP address is", wifi.radio.ipv4_address)
```

Finally, google.com is pinged. The amount of time it takes to ping is printed to the REPL and the code stops running.

```python
#  pings Google
ipv4 = ipaddress.ip_address("8.8.4.4")
print("Ping google.com: %f ms" % (wifi.radio.ping(ipv4)*1000))
```

By successfully running this WiFi test code, you can confirm that your board is connecting to WiFi with CircuitPython successfully and you can move on to more advanced projects.

# Adafruit ESP32-C6 Feather

## Adafruit IO

Adafruit IO gives you the option to disconnect your microcontroller from your computer and run it off of USB power or a battery, and still be able to see the data. It also allows you to send data to your microcontroller, such as NeoPixel colors. This example shows how to both send data to and receive data from Adafruit IO. It pulls from a "random" number generator and sends the "random" number _to_ Adafruit IO, while simultaneously listening for NeoPixel color data _from_ Adafruit IO.

## NeoPixel Location
![](https://cdn-learn.adafruit.com/assets/assets/000/131/990/medium800/adafruit_products_neo.jpg?1724356192)

## Adafruit IO Feeds and Dashboard

The first thing you'll need to do, is head over to [Adafruit IO](https://io.adafruit.com/) and make sure your account is set up.

Then, you need to [create two feeds](https://learn.adafruit.com/adafruit-io-basics-feeds/creating-a-feed) called **neopixel** and **random**. These are case sensitive!

Next, you'll [create a dashboard](https://learn.adafruit.com/adafruit-io-basics-dashboards/creating-a-dashboard) for the NeoPixel Color Picker. You can name the dashboard whatever you like.

Once the dashboard is created, you'll want to [add a color picker block](https://learn.adafruit.com/adafruit-io-basics-dashboards/adding-blocks). The color picker block is highlighted by a red arrow in the image below.

![](https://cdn-learn.adafruit.com/assets/assets/000/109/400/medium800/adafruit_io_send_and_recieve_data_AIO_choose_color_picker_block.png?1646162219)

Once you choose the color picker block, you'll need to connect a feed to it. Check the box next to **neopixel**.

![](https://cdn-learn.adafruit.com/assets/assets/000/109/402/medium800/adafruit_io_send_and_recieve_data_AIO_connect_a_feed_to_color_picker.png?1646162290)

Finally, a Block Settings page will come up. You can add an optional block title here. Then you press **Create Block**.

![](https://cdn-learn.adafruit.com/assets/assets/000/109/403/medium800/adafruit_io_send_and_recieve_data_AIO_color_picker_block_settings.png?1646162334)

The dashboard should look something like the following.

![](https://cdn-learn.adafruit.com/assets/assets/000/109/404/medium800/adafruit_io_send_and_recieve_data_AIO_Dashboard_color_picker.png?1646162566)

Now that things are set up on the Adafruit IO end, you can continue on to the code on your microcontroller!

## Adafruit IO settings.toml

This example requires you to provide your Wi-Fi credentials, and your Adafruit IO username and key. To do this, you'll want to create a **settings.toml** file on your **CIRCUITPY** drive.

To obtain your Adafruit IO key, follow [the initial steps on this page](https://learn.adafruit.com/adafruit-io-home-security/adafruit-io-setup).

Your **settings.toml** file should be structured in a certain way, and contain all the necessary information. Follow these instructions to [create your settings.toml file](https://learn.adafruit.com/pico-w-wifi-with-circuitpython/create-your-settings-toml-file).

## Adafruit IO Example Code

To run this example, you need to first install the NeoPixel, Adafruit IO, and Adafruit MiniMQTT libraries into the **lib** folder on your board. Then you need to update **code.py** with the example script.

In the example below, click the&nbsp; **Download Project Bundle** button below to download the necessary libraries and the **code.py** file in a zip file. Extract the contents of the zip file. You'll see a **code.py** file and **/lib** folder.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/CircuitPython_Templates/adafruit_io_cpu_temp_neopixel_color/code.py

## Update the **/lib** Folder
In the editor window in your browser, click the **Open** button to view the file dialog. Then, click the **Upload** button and select **Upload Folders**.

![adafruit_io_send_and_recieve_data_uploadFolders.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/923/medium640/adafruit_io_send_and_recieve_data_uploadFolders.jpg?1724097455)

Navigate to the project bundle that you downloaded and select the **/lib folder**.

![adafruit_io_send_and_recieve_data_ioLib.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/924/medium640/adafruit_io_send_and_recieve_data_ioLib.jpg?1724097754)

You'll be asked if you want to upload the **/lib** folder from the&nbsp;Project Bundle. Click **Upload**.

![adafruit_io_send_and_recieve_data_ioUpload.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/925/medium640/adafruit_io_send_and_recieve_data_ioUpload.jpg?1724097803)

After the upload finishes, you can open the **lib** folder to view the library files required for the Adafruit IO example.

![adafruit_io_send_and_recieve_data_ioLibs.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/926/medium640/adafruit_io_send_and_recieve_data_ioLibs.jpg?1724097856)

## Update **code.py**
In the editor window in your browser, click the **Open** button to view the file dialog. Then, click the **Upload** button and select **Upload Files**.

![adafruit_io_send_and_recieve_data_upload.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/927/medium640/adafruit_io_send_and_recieve_data_upload.jpg?1724097889)

Navigate to the project bundle that you downloaded and select the **code.py** file.

![adafruit_io_send_and_recieve_data_code_dot_py.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/928/medium640/adafruit_io_send_and_recieve_data_code_dot_py.jpg?1724097913)

You'll be asked if you want to overwrite the previous **code.py** with the new **code.py** file from the Project Bundle. Click **OK**.

![adafruit_io_send_and_recieve_data_overwrite.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/929/medium640/adafruit_io_send_and_recieve_data_overwrite.jpg?1724097932)

## Update Your **settings.toml** File

Remember to add your **settings.toml** file as described earlier in this page. You'll need to include your `ADAFRUIT_AIO_USERNAME`, `ADAFRUIT_AIO_KEY`, `CIRCUITPY_WIFI_SSID` and `CIRCUITPY_WIFI_PASSWORD` in the file.

You can edit the file manually in the USB code editor by clicking **Open** , selecting **settings.toml** and clicking **Open** at the bottom of the dialog box.

![adafruit_io_send_and_recieve_data_openSettingsDotToml.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/930/medium640/adafruit_io_send_and_recieve_data_openSettingsDotToml.jpg?1724098044)

With **settings.toml** open in the editor, you can add your WiFi and Adafruit IO credentials:

`CIRCUITPY_WIFI_SSID = "your-ssid-here"`  
`CIRCUITPY_WIFI_PASSWORD = "your-ssid-password-here"`  
`ADAFRUIT_AIO_USERNAME = "your-aio-username-here"`  
`ADAFRUIT_AIO_KEY = "your-aio-key-here"`

Once your credentials are entered, click **Save** above the editor to save your changes to **settings.toml**.

![adafruit_io_send_and_recieve_data_ioSettingsToml.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/931/medium640/adafruit_io_send_and_recieve_data_ioSettingsToml.jpg?1724098221)

Once everything is saved to the&nbsp;board, **Restart** the Serial Console to run the new **code.py**. You'll see the connection info and current readings printed out in the console.

![](https://cdn-learn.adafruit.com/assets/assets/000/131/932/medium800/adafruit_products_Screenshot_2024-08-19_164617.png?1724100469)

## NeoPixel Color Change

To change the color of the NeoPixel, go to the NeoPixel Adafruit IO dashboard you created at the beginning, and click on the colored circle in the ColorPicker block. It will bring up the following.

![](https://cdn-learn.adafruit.com/assets/assets/000/109/405/medium800/adafruit_io_send_and_recieve_data_AIO_color_picker_choose_color.png?1646162719)

You can move the dot in the box around, and the slider line across the gradient to choose the perfect color. Choose a new color and click **SAVE**.

The NeoPixel color will update, and you will see the new value printed to the serial console, as shown below.

![](https://cdn-learn.adafruit.com/assets/assets/000/109/433/medium800/adafruit_io_send_and_recieve_data_AIO_template_serial_output_neopixel_color_change.png?1646242768)

## Code Walkthrough

This example contains three `try`/`except` blocks. These are included where the code is likely to fail due to WiFi or Adafruit IO connection failures. WiFi can be finicky, and without these code blocks, if the connection was lost, the code would crash. Instead, it is designed to reset the board and start the code over again to reestablish the connection, regardless of the cause. This ensures your code will continue running. The details of these blocks are explained below.

First you import all of the necessary modules and libraries.

```python
import time
import ssl
import os
from random import randint
import socketpool
import wifi
import board
import neopixel
import adafruit_minimqtt.adafruit_minimqtt as MQTT
from adafruit_io.adafruit_io import IO_MQTT
```

Info: Note that if a **settings.toml** file is not present on your **CIRCUITPY** drive, the code will fail to run, and you will receive an error in the serial console. Add a **settings.toml** file to your **CIRCUITPY** drive to resolve this error.

The WiFi attempts to connect, and prints the status to the serial console. If it connects successfully, the code continues onto the NeoPixel set up.

```python
try:
    print("Connecting to %s" % os.getenv("CIRCUITPY_WIFI_SSID"))
    wifi.radio.connect(os.getenv("CIRCUITPY_WIFI_SSID"), os.getenv("CIRCUITPY_WIFI_PASSWORD"))
    print("Connected to %s!" % os.getenv("CIRCUITPY_WIFI_SSID"))
```

If the WiFi connection is not successful, the error will be printed to the serial console, and the board will hard reset after 30 seconds.

```python
except Exception as e:  # pylint: disable=broad-except
    print("Failed to connect to WiFi. Error:", e, "\nBoard will hard reset in 30 seconds.")
    time.sleep(30)
    microcontroller.reset()
```

Once the WiFi successfully connects, the NeoPixel object is initiated.

```python
pixel = neopixel.NeoPixel(board.NEOPIXEL, 1, brightness=0.3)
```

Following that are two callback methods. For more details, check out [this guide](https://learn.adafruit.com/mqtt-in-circuitpython/code-walkthrough#minimqtt-callback-methods-3034067-9). The `connected` method subscribes to the neopixel feed on Adafruit IO. The `message` callback checks for updates to the neopixel feed, and turns the pixel the color from the feed.

```python
def connected(client):
    print("Connected to Adafruit IO!  Listening for NeoPixel changes...")
    # Subscribe to Adafruit IO feed called "neopixel"
    client.subscribe("neopixel")


# pylint: disable=unused-argument
def message(client, feed_id, payload):
    print("Feed {0} received new value: {1}".format(feed_id, payload))
    if feed_id == "neopixel":
        pixel.fill(int(payload[1:], 16))
```

You create a socket pool, use that to initialise the new MQTT Client object, and use that to initialise the Adafruit IO MQTT "helper".

```python
pool = socketpool.SocketPool(wifi.radio)

mqtt_client = MQTT.MQTT(
    broker="io.adafruit.com",
    username=os.getenv("ADAFRUIT_AIO_USERNAME"),
    password=os.getenv("ADAFRUIT_AIO_KEY"),
    socket_pool=pool,
    ssl_context=ssl.create_default_context(),
)

io = IO_MQTT(mqtt_client)
```

You set up the callback methods mentioned above.

```python
io.on_connect = connected
io.on_message = message
```

Next, you attempt to connect the client to the MQTT broker. If connection is successful, the code continues on to the `timestamp`.

```python
try:
    io.connect()
```

If the MQTT broker connection is not successful, the error is printed to the serial console, and the board will hard reset after 30 seconds.

```python
except Exception as e:
    print("Failed to connect to Adafruit IO. Error:", e, "\nBoard will hard reset in 30 seconds.")
    time.sleep(30)
    microcontroller.reset()
```

Once the broker is connected, you set the `timestamp` to `0` immediately before the loop.

```python
timestamp = 0
```

Inside the loop, you attempt to do two things. You first explicitly poll the message loop. Check out [this guide](https://learn.adafruit.com/mqtt-in-circuitpython/advanced-minimqtt-usage#minimqtt-loop-3034264-1) for more details on that.

```python
while True:
    try:
        io.loop()
```

Second, you have a block of code that runs every 10 seconds. Inside, you obtain a "random" value between 0-255 inclusive, print it to the serial console, and publish it to an Adafruit IO feed. Finally, you reset timestamp so the block of code knows when another 10 seconds has passed, and runs again.

```python
[...]
        if (time.monotonic() - timestamp) &gt;= 10:
            random_number = "{}".format(randint(0, 255))
            print("Current 'random' number: {}".format(random_number))
            io.publish("random", random_number)
            timestamp = time.monotonic()
```

If at any time WiFi or Adafruit IO disconnects, the code will print the error to the serial console, and the board will hard reset after 30 seconds.

```python
[...]
    except Exception as e:
        print("Failed to get or send data, or connect. Error:", e,
              "\nBoard will hard reset in 30 seconds.")
        time.sleep(30)
        microcontroller.reset()
```

That's all there is to using CircuitPython and Adafruit IO to send data to Adafruit IO, and receive data from it!

# Adafruit ESP32-C6 Feather

## Arduino IDE Setup

### Install Arduino IDE

The first thing you will need to do is to download the latest release of the Arduino IDE. You will need to&nbsp;be using&nbsp; **version 1.8** &nbsp;or higher for this guide

[Arduino IDE Download](http://www.arduino.cc/en/Main/Software)
### Install ESP32 Board Support Package

After you have downloaded and installed **&nbsp;the latest version of Arduino IDE** , you will need to start the IDE&nbsp;and navigate to&nbsp;the&nbsp; **Preferences** &nbsp;menu. You can access it from the&nbsp; **File** &nbsp;menu in&nbsp;_Windows_&nbsp;or&nbsp;_Linux_, or the&nbsp; **Arduino** &nbsp;menu on&nbsp;_OS X_.

![](https://cdn-learn.adafruit.com/assets/assets/000/101/639/medium800/esp32_s2_arduino_ide_setup_flora_prefs.png?1618870383)

A dialog will pop up just like the one shown below.

![](https://cdn-learn.adafruit.com/assets/assets/000/101/640/medium800/esp32_s2_arduino_ide_setup_flora_Screen_Shot_2015-05-07_at_9.07.21_AM.png?1618870405)

We will be adding a URL to the new&nbsp; **Additional Boards Manager URLs** &nbsp;option. The list of URLs is comma separated, and&nbsp;_you will only have to add each&nbsp;URL once._&nbsp;New Adafruit boards and updates to existing boards&nbsp;will automatically be picked up&nbsp;by the Board Manager each time&nbsp;it is opened. The URLs point to index files that the Board Manager uses to build the list of available & installed boards.

To find the most up to date list of URLs you can&nbsp;add, you can visit the list of&nbsp;[third party board URLs on the Arduino IDE wiki](https://github.com/arduino/Arduino/wiki/Unofficial-list-of-3rd-party-boards-support-urls#list-of-3rd-party-boards-support-urls). We will only need to add one URL to the IDE in this example, but&nbsp;_ **you can add multiple URLS by separating them with commas** _. Copy and paste the link below into the&nbsp; **Additional Boards Manager URLs** &nbsp;option in the Arduino IDE preferences.

`https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json`

![](https://cdn-learn.adafruit.com/assets/assets/000/101/641/medium800/esp32_s2_arduino_ide_setup_Screen_Shot_2021-04-19_at_3.14.19_PM.png?1618870509)

If you have multiple boards you want to support, say ESP8266 and Adafruit, have both URLs in the text box separated by a comma (,)

Once done click&nbsp; **OK** &nbsp;to save the new preference settings.

The next step is to actually install the Board Support Package (BSP). Go to the **Tools → Board → Board Manager** &nbsp;submenu. A dialog should come up with various BSPs. Search for **esp32**.

![](https://cdn-learn.adafruit.com/assets/assets/000/107/162/medium800/esp32_s2_arduino_ide_setup_Screen_Shot_2021-12-09_at_9.58.40_AM.png?1639072797)

Click the **Install** button and wait for it to finish. Once it is finished, you can close the dialog.

In the **Tools → Board** submenu you should see **ESP32 Arduino** and in that dropdown it should contain the ESP32 boards along with all the latest ESP32 boards.

Look for the board called Adafruit Feather ESP32-C6.

![](https://cdn-learn.adafruit.com/assets/assets/000/131/986/medium800/adafruit_products_arduinoIDE.jpg?1724346388)

The upload speed can be changed: faster speed makes uploads take less time but sometimes can cause upload issues. **921600** should work fine, but if you're having issues, you can drop down lower.

# Adafruit ESP32-C6 Feather

## Blink

The first and most basic program you can upload to your Arduino is the classic Blink sketch. This takes something on the board and makes it, well, blink! On and off. It's a great way to make sure everything is working and you're uploading your sketch to the right board and right configuration.

When all else fails, you can always come back to Blink!

![](https://cdn-learn.adafruit.com/assets/assets/000/132/005/medium800thumb/adafruit_products_blink.jpg?1724430035)

# Pre-Flight Check: Get Arduino IDE & Hardware Set Up

This lesson assumes you have Arduino IDE set up. This is a generalized checklist, some elements may not apply to your hardware. If you haven't yet, check the previous steps in the guide to make sure you:

- **Install the very latest Arduino IDE for Desktop** (not all boards are supported by the Web IDE so we don't recommend it)
- **Install any board support packages (BSP) required for your hardware.** Some boards are built in defaults on the IDE, but lots are not! You may need to install plug-in support which is called the BSP.
- **Get a Data/Sync USB cable for connecting your hardware.** A _significant_ amount of problems folks have stem from not having a USB cable with data pins. Yes, these cursed cables roam the land, making your life hard. If you find a USB cable that doesn't work for data/sync, _throw it away immediately_! There is no need to keep it around, cables are very inexpensive these days.
- **Install any drivers required** - If you have a board with a FTDI or CP210x chip, you may need to get separate drivers. If your board has native USB, it probably doesn't need anything. After installing, reboot to make sure the driver sinks in.
- **Connect the board to your computer.** If your board has a power LED, make sure it's lit. Is there a power switch? Make sure its turned On!

# Start up Arduino IDE and Select Board/Port

OK now you are prepared! Open the Arduino IDE on your computer. Now you have to tell the IDE what board you are using, and how you want to connect to it.

In the IDE find the **Tools** menu. You will use this to select the board. If you switch boards, you _must switch the selection!_ So always double-check before you upload code in a new session.

![](https://cdn-learn.adafruit.com/assets/assets/000/131/988/medium800/adafruit_products_Screenshot_2024-08-22_151226.png?1724354037)

Info: If you have any issues accessing the Serial Monitor, make sure that USB CDC On Boot is set to <b>Enabled.

# New Blink Sketch

OK lets make a new blink sketch! From the **File** menu, select **New**

![](https://cdn-learn.adafruit.com/assets/assets/000/107/498/medium800/blink__image.png?1640454932)

Then in the new window, copy and paste this text:

```auto
int led = LED_BUILTIN;

void setup() {
  // Some boards work best if we also make a serial connection
  Serial.begin(115200);

  // set LED to be an output pin
  pinMode(led, OUTPUT);
}

void loop() {
  // Say hi!
  Serial.println("Hello!");
  
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(500);                // wait for a half second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(500);                // wait for a half second
}
```

Info: 

One note you'll see is that we reference the LED with the constant `LED_BUILTIN` rather than a number. That's because, historically, the built in LED was on pin 13 for Arduinos. But in the decades since, boards don't always have a pin 13, or maybe it could not be used for an LED. So the LED could have moved to another pin. It's best to use `LED_BUILTIN` so you don't get the pin number confused!

The red LED on the Feather ESP32-C6 is available as `LED_BUILTIN`, as well as `15`.

# Verify (Compile) Sketch

OK now you can click the Verify button to convert the sketch into binary data to be uploaded to the board.

Note that Verifying a sketch is the same as Compiling a sketch - so we will use the words interchangeably

![](https://cdn-learn.adafruit.com/assets/assets/000/107/503/medium800/blink__image.png?1640455847)

During verification/compilation, the computer will do a bunch of work to collect all the libraries and code and the results will appear in the bottom window of the IDE

![](https://cdn-learn.adafruit.com/assets/assets/000/107/500/medium800/blink__image.png?1640455335)

If something went wrong with compilation, you will get red warning/error text in the bottom window letting you know what the error was. It will also highlight the line with an error

For example, here I had the wrong board selected - and the selected board does not have a built in LED!

![](https://cdn-learn.adafruit.com/assets/assets/000/107/501/medium800/blink__image.png?1640455513)

Here's another common error, in my haste I forgot to add a `;` at the end of a line. The compiler warns me that it's looking for one - note that the error is actually a few lines up!

![](https://cdn-learn.adafruit.com/assets/assets/000/107/502/medium800/blink__image.png?1640455650)

Info: Turning on detailed compilation warnings and output can be very helpful sometimes - It's in Preferences under "Show Verbose Output During:" and check the Compilation button. If you ever need to get help from others, be sure to do this and then provide all the text that is output. It can assist in determining what happened!

On success you will see something like this white text output and the message **Done compiling.** in the message area.

![](https://cdn-learn.adafruit.com/assets/assets/000/107/504/medium800/blink__image.png?1640455995)

# Upload Sketch

Once the code is verified/compiling cleanly you can upload it to your board. Click the **Upload** button

![](https://cdn-learn.adafruit.com/assets/assets/000/107/499/medium800/blink__image.png?1640455265)

The IDE will try to compile the sketch again for good measure, then it will try to connect to the board and upload a the file.

**This is actually one of the hardest parts for beginners because it's where a lot of things can go wrong.**

However, lets start with what it looks like on success! Here's what your board upload process looks like when it goes right:

![](https://cdn-learn.adafruit.com/assets/assets/000/131/987/medium800/adafruit_products_Screenshot_2024-08-22_151148.png?1724354034)

Often times you will get a warning like this, which is kind of vague:

`No device found on COM66` (or whatever port is selected)  
`An error occurred while uploading the sketch`

![](https://cdn-learn.adafruit.com/assets/assets/000/107/505/medium800/blink__image.png?1640456582)

This could be a few things.

First up, **check again that you have the correct board selected!** Many electronics boards have very similar names or look, and often times folks grab a board different from what they thought.

Second, **make sure you selected the right port!** If you have the wrong port or no port selected, Arduino doesn't know where to look for your board.

If both of those are correct, the next step is to enable verbose upload messages.

Before continuing we _really really_ suggest turning on **Verbose Upload** messages, it will help in this process because you will be able to see what the IDE is trying to do. It's a checkbox in the **Preferences** menu.

![](https://cdn-learn.adafruit.com/assets/assets/000/107/507/medium800/blink__image.png?1640457254)

Now you can try uploading again!

![](https://cdn-learn.adafruit.com/assets/assets/000/107/506/medium800/blink__image.png?1640457185)

This time, you should have success!

After uploading this way, be sure to **click the reset button** - it sort of makes sure that the board got a good reset and will come back to life nicely.

# Finally, a Blink!

OK it was a journey but now we're here and you can enjoy your blinking LED. Next up, try to change the delay between blinks and re-upload. It's a good way to make sure your upload process is smooth and practiced.

![](https://cdn-learn.adafruit.com/assets/assets/000/132/006/medium800thumb/adafruit_products_blink.jpg?1724430163)

# Adafruit ESP32-C6 Feather

## I2C

A lot of sensors, displays, and devices can connect over I2C. I2C is a 2-wire 'bus' that allows multiple devices to all connect on one set of pins so it's very convenient for wiring!

When using your board, you'll probably want to connect up I2C devices, and it can be a little tricky the first time. The best way to debug I2C is go through a checklist and then perform an I2C scan

# Common I2C Connectivity Issues

- **Have you connected four wires (at a minimum) for each I2C device?** Power the device with whatever is the logic level of your microcontroller board (probably 3.3V), then a ground wire, and a SCL clock wire, and and a SDA data wire.
- **If you're using a STEMMA QT board - check if the power LED is lit.** It's usually a green LED to the left side of the board.
- **Does the STEMMA QT/I2C port have switchable power or pullups?** To reduce power, some boards have the ability to cut power to I2C devices or the pullup resistors. Check the documentation if you have to do something special to turn on the power or pullups.
- **If you are using a DIY I2C device, do you have pullup resistors?** Many boards do _not_ have pullup resistors built in and they are _required!_ We suggest any common 2.2K to 10K resistors. You'll need two: one each connects from SDA to positive power, and SCL to positive power. Again, positive power (a.k.a VCC, VDD or V+) is often 3.3V
- **Do you have an address collision?** You can only have _one_ board per address. So you cannot, say, connect two AHT20's to one I2C port because they have the same address and will interfere. Check the sensor or documentation for the address. Sometimes there are ways to adjust the address.
- **Does your board have multiple I2C ports?** Historically, boards only came with one. But nowadays you can have two or even three! This can help solve the "hey, but what if I want two devices with the same address" problem: just put one on each bus.
- **Are you hot-plugging devices?** I2C does _not_ support dynamic re-connection, you cannot connect and disconnect sensors as you please. They should all be connected on boot and not change. ([Only exception is if you're using a hot-plug assistant but that'll cost you](https://www.adafruit.com/product/5159)).
- **Are you keeping the total bus length reasonable?** I2C was designed for maybe 6" max length. We like to push that with plug-n-play cables, but really please keep them as short as possible! ([Only exception is if you're using an active bus extender](https://www.adafruit.com/product/4756)).

The Feather ESP32-C6 has a `NEOPIXEL_I2C_POWER` pin that must be pulled `HIGH` to enable power to the STEMMA QT port. This is done automatically in the board support package in Arduino, but if you find you're having issues definitely double check that it is pulled `HIGH`!

# Perform an I2C scan!

### Install TestBed Library

To scan I2C, the Adafruit TestBed library is used. This library and example just makes the scan a little easier to run because it takes care of some of the basics. You will need to add support by installing the library. Good news: it is _very easy_ to do it. Go to the **Arduino Library Manager.**

![](https://cdn-learn.adafruit.com/assets/assets/000/107/555/medium800/i2c_scan_test_installlib.png?1640562425)

Search for **TestBed** and install the **Adafruit TestBed** library

![](https://cdn-learn.adafruit.com/assets/assets/000/107/556/medium800/i2c_scan_test_testbedlib.png?1640562581)

Now open up the I2C Scan example

![](https://cdn-learn.adafruit.com/assets/assets/000/107/557/medium800/i2c_scan_test_i2cscan.png?1640562632)

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/I2C_Scanners/arduino/i2c_scanner/i2c_scanner.ino

### Wire up I2C device

While the examples here will be using the [Adafruit MCP9808](https://www.adafruit.com/product/5027), a high accuracy temperature sensor, the overall process is the same for just about any I2C sensor or device.

The first thing you'll want to do is get the sensor connected so your board has I2C to talk to.

### Adafruit MCP9808 High Accuracy I2C Temperature Sensor Breakout

[Adafruit MCP9808 High Accuracy I2C Temperature Sensor Breakout](https://www.adafruit.com/product/5027)
The MCP9808 digital temperature sensor is one of the more accurate/precise we've ever seen, with a typical accuracy of ±0.25°C over the sensor's -40°C to +125°C range and precision of +0.0625°C. They work great with any microcontroller using standard I2C. With...

Out of Stock
[Buy Now](https://www.adafruit.com/product/5027)
[Related Guides to the Product](https://learn.adafruit.com/products/5027/guides)
![Top view of temperature sensor breakout above an OLED display FeatherWing. The OLED display reads "MCP9808 Temp: 24.19ºC"](https://cdn-shop.adafruit.com/640x480/5027-04.jpg)

### STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long

[STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long](https://www.adafruit.com/product/4399)
This 4-wire cable is&nbsp;50mm / 1.9" long and fitted with JST SH female 4-pin connectors on both ends. Compared with the chunkier JST PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4399)
[Related Guides to the Product](https://learn.adafruit.com/products/4399/guides)
![Angled of of JST SH 4-Pin Cable.](https://cdn-shop.adafruit.com/640x480/4399-00.jpg)

## Wiring the MCP9808

The MCP9808 comes with a STEMMA QT connector, which makes wiring it up quite simple and solder-free.

![](https://cdn-learn.adafruit.com/assets/assets/000/132/000/medium800/adafruit_products_i2cScan_bb.jpg?1724428136)

Now upload the scanning sketch to your microcontroller and open the serial port to see the output. You should see something like this:

You'll see two addresses in the Serial Monitor: **0x18** for the MCP9808 sensor and **0x36** for the built-in MAX17048.

Info: If you have any issues accessing the Serial Monitor, make sure that USB CDC On Boot is set to <b>Enabled for the Feather.

![](https://cdn-learn.adafruit.com/assets/assets/000/131/989/medium800/adafruit_products_Screenshot_2024-08-22_152201.png?1724354535)

# Adafruit ESP32-C6 Feather

## MAX17048 Simple Data

Your microcontroller board comes with a **MAX17048 lithium ion polymer (lipoly) battery monitor&nbsp;**built right onto the board. The MAX17048 is available over I2C.

The sensor comes with its own Adafruit CircuitPython library that makes it simple to write code to read data from it. This example will be using, among other things, the&nbsp;[Adafruit\_MAX1704X](https://github.com/adafruit/Adafruit_MAX1704X)&nbsp;library.

The example simply reads data from the sensor and prints it to the serial console. It is designed to show you how to get data from the sensor.

![](https://cdn-learn.adafruit.com/assets/assets/000/131/996/medium800/adafruit_products_maxRed.jpg?1724360283)

The&nbsp; **MAX17048 battery monitor** &nbsp;(highlighted in red) is immediately below the **USB** pin label. Its I2C address is&nbsp; **0x36**.

## Arduino Library Installation

You can install the necessary libraries from the Library Manager. To open, click **Sketch \> Include Library \> Manage Libraries...**

![](https://cdn-learn.adafruit.com/assets/assets/000/118/368/medium800/max17048_simple_data_Arduino_Open_Library_Manager.png?1675964472)

Search for **MAX17048** , and install the **Adafruit**  **MAX1704X** library.

![](https://cdn-learn.adafruit.com/assets/assets/000/118/369/medium800/max17048_simple_data_maxLibSearch.jpg?1675964503)

When asked about installing dependencies, click **Install all**.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/118/370/medium800/max17048_simple_data_maxLibDepends.jpg?1675964522)

## MAX17048 Simple Data Example

Click **File \> Examples \> Adafruit MAX1704X \> MAX17048\_basic** to open the example.

https://github.com/adafruit/Adafruit_MAX1704X/blob/main/examples/MAX17048_basic/MAX17048_basic.ino

Info: If you have any issues accessing the Serial Monitor, make sure that USB CDC On Boot is set to <b>Enabled.

After opening the **MAX17048\_basic** file, upload it to your microcontroller. Open the **Serial Monitor** at **115200 baud**. Plug in a lipo battery to the JST-PH battery port. You should see the battery voltage and percentage data print to the Serial Monitor as the sketch runs.

![](https://cdn-learn.adafruit.com/assets/assets/000/118/371/medium800/max17048_simple_data_maxDemoSerial.jpg?1675964617)

# Adafruit ESP32-C6 Feather

## WiFi Test

Thankfully if you have ESP32 sketches, they'll 'just work' with variations of ESP32. You can find a wide range of examples in the **File-\>Examples-\>Examples for Adafruit Metro ESP32-S2** subheading (the name of the board may vary so it could be **"Examples for Adafruit Feather ESP32 V2"** etc)

![](https://cdn-learn.adafruit.com/assets/assets/000/097/028/medium800/adafruit_products_image.png?1605222761)

Let's start by scanning the local networks.

**Load up the WiFiScan example** under **Examples-\>Examples for YOUR BOARDNAME-\>WiFi-\>WiFiScan**

![](https://cdn-learn.adafruit.com/assets/assets/000/096/993/medium800/adafruit_products_Screen_Shot_2020-11-11_at_12.28.51_PM.png?1605115789)

And **upload this example to your board**. The ESP32 should scan and find WiFi networks around you.

For ESP32, open the serial monitor, to see the scan begin.

For ESP32-S2, -S3 and -C3, don't forget you have to click Reset after uploading through the ROM bootloader. Then select the new USB Serial port created by the ESP32. It will take a few seconds for the board to complete the scan.

![](https://cdn-learn.adafruit.com/assets/assets/000/097/029/medium800/adafruit_products_image.png?1605223012)

If you can not scan any networks, check your power supply. You need a solid power supply in order for the ESP32 to not brown out. A skinny USB cable or drained battery can cause issues.

## WiFi Connection Test

Now that you can scan networks around you, its time to connect to the Internet!

Copy the example below and paste it into the Arduino IDE:

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/ESP32_S2_WiFi_Tests/WiFiWebClient/WiFiWebClient.ino

 **NOTE:** You must **change the `SECRET_SSID` and `SECRET_PASS` in the example code to your WiFi SSID and password** before uploading this to your board.

![](https://cdn-learn.adafruit.com/assets/assets/000/097/030/medium800/adafruit_products_image.png?1605223125)

After you've set it correctly, upload and check the serial monitor. You should see the following. If not, go back, check wiring, power and your SSID/password

![](https://cdn-learn.adafruit.com/assets/assets/000/097/009/medium800/adafruit_products__dev_cu_usbmodem14101.png?1605127946)

Info: If you have issues establishing a connection, try power cycling the board by unplugging and replugging the USB cable.

# Adafruit ESP32-C6 Feather

## WipperSnapper Setup

Warning: 

## What is WipperSnapper

WipperSnapper is a firmware designed to turn any WiFi-capable board into an Internet-of-Things device without programming a single line of code. WipperSnapper connects to [Adafruit IO](https://io.adafruit.com/), a web&nbsp;platform designed ([by Adafruit!](https://www.adafruit.com/about)) to&nbsp;_display_,&nbsp;_respond_, and&nbsp;_interact_&nbsp;with your project's data.

Simply load the WipperSnapper firmware onto your board, add credentials, and plug it into power. Your board will automatically register itself with your Adafruit IO account.

From there, you can add&nbsp;_components_&nbsp;to your board such as buttons, switches, potentiometers, sensors, and more! Components are&nbsp;_dynamically&nbsp;_added to hardware, so you can&nbsp;immediately start interacting, logging, and streaming the data your projects produce without writing code.

## Sign up for Adafruit.io

You will need an Adafruit IO account to use WipperSnapper on your board. If you do not already have one, head over to [io.adafruit.com](https://io.adafruit.com/) to create a&nbsp;_free_ account.

## Add a New Device to Adafruit IO

Log into your [Adafruit IO](https://io.adafruit.com/) account. Click the _New Device_ button at the top of the page.

![](https://cdn-learn.adafruit.com/assets/assets/000/112/548/medium800/wippersnapper_setup__board_selector__web__new_device_1.png?1655919766)

After clicking New Device, you should be on the _board selector_ page. This page displays every board that is compatible with the WipperSnapper firmware.

![](https://cdn-learn.adafruit.com/assets/assets/000/112/550/medium800/wippersnapper_setup__board_selector__web__selector_maion.png?1655920178)

In the board selector page's search bar, search for the&nbsp;_ESP32-C6 Feather.&nbsp;_Once you've located the board you'd like to install WipperSnapper on,_&nbsp;_click the&nbsp;_Choose Board_&nbsp;button to bring you to the self-guided installation wizard.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/432/medium800/adafruit_products_3fjV8FIvFM.png?1736778882)

Follow the step-by-step instructions on the page to install Wippersnapper on your device and connect it to Adafruit IO.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/435/medium800/adafruit_products_vSVzNnZu8O.png?1736779241)

If the installation was successful, a popover should appear displaying that your board has successfully been detected by Adafruit IO.

Give your board a name and click "Continue to Device Page".

![](https://cdn-learn.adafruit.com/assets/assets/000/134/520/medium800/adafruit_products_Screenshot_2025-01-17_at_18.29.12.png?1737138624)

You should be brought to your board's device page.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/521/medium800/adafruit_products_Screenshot_2025-01-17_at_18.34.26.png?1737139051)

## Feedback

Adafruit.io WipperSnapper is in **beta** and you can help improve it!

If you have&nbsp; suggestions or general feedback about the installation process - visit [https://io.adafruit.com/support](https://io.adafruit.com/support), click _"Contact Adafruit IO Support"_ and select _"I have feedback or suggestions for the WipperSnapper Beta"._

## Troubleshooting

If you encountered an issue during installation, please try the steps below first.

If you're still unable to resolve the issue, or if your issue is not listed below, get in touch with us directly at [https://io.adafruit.com/support](https://io.adafruit.com/support "https://io.adafruit.com/support"). Make sure to click&nbsp; _"Contact Adafruit IO Support"_ and select "_There is an issue with WipperSnapper. Something is broken!"_

### 

First, make sure that you selected the correct board on the board selector.

Next, please make sure that you entered your WiFi credentials properly, there are no spaces/special characters in either your network name (SSID) or password, and that you are connected to a 2.4GHz wireless network.

If you're still unable to connect your board to WiFi, please [make a new post on the WipperSnapper technical support forum with the error you're experiencing, the LED colors which are blinking, and the board you're using.](https://forums.adafruit.com/viewforum.php?f=66)

### 

Try hard-resetting your board by unplugging it from USB power and plugging it back in.

If the error is still occurring, please&nbsp;[make a new post on the WipperSnapper technical support forum with information about what you're experiencing, the LED colors which are blinking (if applicable), and the board you're using.](https://forums.adafruit.com/viewforum.php?f=66)

## "Uninstalling" WipperSnapper&nbsp;

WipperSnapper firmware is an application that is loaded onto your board. There is nothing to "uninstall". However, you may want to "move" your board from running WipperSnapper to running Arduino or CircuitPython. You also may need to restore your board to the state it was shipped to you from the Adafruit factory.&nbsp;

### Moving from WipperSnapper to CircuitPython

Follow the steps on the [Installing CircuitPython page](https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython) to install CircuitPython on your board running WipperSnapper.

- If you are unable to double-tap the RST button to enter the UF2 bootloader, follow the _"Factory Resetting a WipperSnapper Board"_ instructions below.

Uploading this sketch will overwrite WipperSnapper. If you want to re-install WipperSnapper, follow the instructions at the top of this page.

### Moving from WipperSnapper to Arduino

If you want to use your board with Arduino, you will use the Arduino IDE to load&nbsp;_any_ sketch onto your board.

First, follow the page below to set up your Arduino IDE environment for use with your board.

[Setup Arduino IDE](https://learn.adafruit.com/adafruit-esp32-c6-feather/arduino-ide-setup-2)
Then, follow the page below to upload the "Arduino Blink" sketch to your board.

[Upload Arduino Blink Sketch](https://learn.adafruit.com/adafruit-esp32-c6-feather/blink)
Uploading this sketch will overwrite WipperSnapper. If you want to re-install WipperSnapper, follow the instructions at the top of this page.

### Factory Resetting a WipperSnapper Board

Sometimes, hardware gets into a state that requires it to be "restored" to the original state it shipped in. If you'd like to get your board back to its original factory state, follow the guide below.

[Factory Reset for C6 Feather](https://learn.adafruit.com/adafruit-esp32-c6-feather/factory-reset)
# Adafruit ESP32-C6 Feather

## WipperSnapper Essentials

![](https://cdn-learn.adafruit.com/assets/assets/000/117/601/medium800/wippersnapper_essentials_heading__required_parts__sensors_boardspread.jpg?1674497784)

You've installed WipperSnapper firmware on your board and connected it to Adafruit IO. Next, let's learn how to use Adafruit IO!

The Adafruit IO supports a large number of _components. Components_ are physical parts such as buttons, switches, sensors, servos, LEDs, RGB LEDs, and more.&nbsp;

The following pages will get you up and running with WipperSnapper as you interact with your board's LED, read the value of a push button, send the value of an I2C sensor to the internet, and wirelessly control colorful LEDs.

### Parts

The following parts are&nbsp; **required** to complete the WipperSnapper essentials pages for this board:

- An I2C sensor like the MCP9808 temperature sensor.&nbsp;

### Adafruit MCP9808 High Accuracy I2C Temperature Sensor Breakout

[Adafruit MCP9808 High Accuracy I2C Temperature Sensor Breakout](https://www.adafruit.com/product/5027)
The MCP9808 digital temperature sensor is one of the more accurate/precise we've ever seen, with a typical accuracy of ±0.25°C over the sensor's -40°C to +125°C range and precision of +0.0625°C. They work great with any microcontroller using standard I2C. With...

Out of Stock
[Buy Now](https://www.adafruit.com/product/5027)
[Related Guides to the Product](https://learn.adafruit.com/products/5027/guides)
![Top view of temperature sensor breakout above an OLED display FeatherWing. The OLED display reads "MCP9808 Temp: 24.19ºC"](https://cdn-shop.adafruit.com/640x480/5027-04.jpg)

Info: You can substitute your sensor for the suggested MCP9808 used in this guide, see your product's learn guide for WipperSnapper instructions tailored specifically to that sensor / component.
If you don't have one then you can test I2C functionality using the onboard I2C battery monitor.

- Cable or set of wires to connect your I2C component (like our handy StemmaQT cables for I2C)

### STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long

[STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long](https://www.adafruit.com/product/4399)
This 4-wire cable is&nbsp;50mm / 1.9" long and fitted with JST SH female 4-pin connectors on both ends. Compared with the chunkier JST PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4399)
[Related Guides to the Product](https://learn.adafruit.com/products/4399/guides)
![Angled of of JST SH 4-Pin Cable.](https://cdn-shop.adafruit.com/640x480/4399-00.jpg)

- A variable resistance component, like a rotary potentiometer or light-dependent resistor

### STEMMA Wired Potentiometer Breakout Board - 10K ohm Linear

[STEMMA Wired Potentiometer Breakout Board - 10K ohm Linear](https://www.adafruit.com/product/4493)
For the easiest way possible to measure twists, turn to this STEMMA potentiometer breakout (ha!). This plug-n-play pot comes with a JST-PH 2mm connector and a matching &nbsp;[JST PH 3-Pin to Male Header Cables - 200mm](https://www.adafruit.com/product/3893), so wiring up is a cinch....

Out of Stock
[Buy Now](https://www.adafruit.com/product/4493)
[Related Guides to the Product](https://learn.adafruit.com/products/4493/guides)
![Video of a white hand turning the knob on a STEMMA Wired Potentiometer Breakout Board connect to a breadboard. Color changes when the knob is twisted. ](https://cdn-shop.adafruit.com/product-videos/640x480/4493-04.jpg)

# Adafruit ESP32-C6 Feather

## LED Blink

Info: This demo shows controlling an LED from Adafruit IO. The same kind of control can be used for relays, lights, motors, or solenoids.

One of the first programs you typically write to get used to embedded programming is a sketch that repeatably blinks an LED. IoT projects are&nbsp;_wireless,_&nbsp;so after completing this section, you'll be able to turn on (or off) the LED built into your board from anywhere in the world.

## Where is the LED on my board?
The Adafruit Feather ESP32-C6 has an onboard Red LED located in the top left of the image, next to the USB-C connector. It is attached to Pin **15** (label on PCB).

![adafruit_products_leds-red.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/134/612/medium640/adafruit_products_leds-red.jpeg?1737587887)

## Create a LED Component on Adafruit IO
On the device page, click the New Component (or "+") button to open the component picker.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/613/medium800/adafruit_products_C6_New_Component.png?1737588097)

Search for the component name by entering&nbsp;`LED`&nbsp;into the text box on the component picker, the list of components should update as soon as you stop typing.

![led_blink_LED_select.png](https://cdn-learn.adafruit.com/assets/assets/000/127/428/medium640/led_blink_LED_select.png?1706755656)

### Filtering and searching for components

Since WipperSnapper supports such a large number of components, there is keyword filtering. Try searching for various keywords, like:

- component names:&nbsp;`aht20`,&nbsp;`servo`,&nbsp;`buzzer`,&nbsp;`button`, `led`, etc
- sensor types:&nbsp;`light`,&nbsp;`temperature`,&nbsp;`pressure`,&nbsp;`humidity`, etc
- interface:&nbsp;`i2c`,&nbsp;`uart`,&nbsp;`ds18x20`,&nbsp;`pin`, etc (also I2C addresses e.g.&nbsp;`0x44`)
- vendor:&nbsp;`Adafruit`,&nbsp;`ASAIR`,&nbsp;`Infineon`,&nbsp;`Bosch`,&nbsp;`Honeywell`,&nbsp;`Sensirion`, etc

There are also product and documentation links to every component. Follow the links beneath the component descriptions to be taken to the appropriate product page or Learn Guide

Select the **LED** from the list of components.

![led_blink_LED_select.png](https://cdn-learn.adafruit.com/assets/assets/000/127/429/medium640/led_blink_LED_select.png?1706755753)

On the Create LED Component form, the board's LED pin is pre-selected.&nbsp;

Click Create Component.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/614/medium800/adafruit_products_Screenshot_2025-01-23_at_01.01.22.png?1737594255)

Behind the scenes, Adafruit IO sends send a command to your board running WipperSnapper telling it to configure "LED Pin" as a digital output.

Your board's page on Adafruit IO shows a new LED component.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/615/medium800/adafruit_products_Screenshot_2025-01-23_at_01.05.58.png?1737594537)

## Usage
On the board page, toggle the LED component by clicking the toggle switch. This should turn your board's built-in LED on or off.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/941/medium800thumb/adafruit_products_led_blink_c6.jpg?1738288170)

# Adafruit ESP32-C6 Feather

## Read a Push-button

Info: This demo shows reading the state of a push-button from WipperSnapper. But the same kind of control can be used for reading switches, break beam sensors, and other digital sensors.

You can configure a board running WipperSnapper to read data from standard input buttons, switches, or digital sensors, and send the value to Adafruit IO.

From Adafruit IO, you will configure one of the pushbuttons on your board as a push button component. Then, when the button is pressed (or released), a value will be published to Adafruit IO.

## Button Location

This example uses the board's built-in push-button and internal pull-up resistor instead of wiring a push-button up.

There is a single input button that can be used with WipperSnapper, furthest from the USB port and labelled **BOOT.** It is connected to pin&nbsp; **IO9** , which is also broken out separately on the Feather and shared with the onboard NeoPixel.  
  
To use it as an input component it must be set to an input with the internal pull-up resistor active.

&nbsp;

![adafruit_products_buttons_boo0.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/561/medium640/adafruit_products_buttons_boo0.jpg?1737489235)

## Create a Push-button Component on Adafruit IO
On the device page, click the New Component (or "+") button to open the component picker.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/616/medium800/adafruit_products_C6_New_Component.png?1737598035)

Search for the component name by entering&nbsp;`push`&nbsp;into the text box on the component picker, the list of components should update as soon as you stop typing.

![read_a_push_button__built_in__5NrzQhD0zT.png](https://cdn-learn.adafruit.com/assets/assets/000/127/430/medium640/read_a_push_button__built_in__5NrzQhD0zT.png?1706749773)

### Filtering and searching for components

Since WipperSnapper supports such a large number of components, you can use filtering. Try searching for various keywords, like:

- component names:` aht20`,&nbsp;`servo`,&nbsp;`buzzer`,&nbsp;`button`,&nbsp;`potentiometer`, etc
- sensor types:&nbsp;`light`,&nbsp;`temperature`,&nbsp;`pressure`,&nbsp;`humidity`, etc
- interface:&nbsp;`i2c`,&nbsp;`uart`,&nbsp;`ds18x20`,&nbsp;`pin`, etc (also I2C addresses e.g.&nbsp;`0x44`)
- vendor:&nbsp;`Adafruit`,&nbsp;`ASAIR`,&nbsp;`Infineon`,&nbsp;`Bosch`,&nbsp;`Honeywell`,&nbsp;`Sensirion`, etc

There are also added product and documentation links for every component. Follow the links beneath the component descriptions to be taken to the appropriate product page or Learn Guide.

Select the **Push Button** &nbsp;from the list of results to go to the component configuration page.

There will be a back button if you select the wrong component, and you can use the Edit component icon (⚙️) on the device page to update the component configuration in the future.

![read_a_push_button__built_in__5NrzQhD0zT.png](https://cdn-learn.adafruit.com/assets/assets/000/127/431/medium640/read_a_push_button__built_in__5NrzQhD0zT.png?1706749847)

The "Create Push Button Component" form&nbsp;presents you with options for configuring the push button.

Start by selecting the board's pin connected to the push button.

Warning: The ESP32-C6 doesn't have many pins available, so the Feather-C6 shares the IO9 pin with the on-board Boot button **and** the NeoPixel. You will only be able to add/use one component on pin IO9 at a time.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/618/medium800/adafruit_products_Screenshot_2025-01-23_at_02.09.20.png?1737600243)

The&nbsp;_Return Interval_&nbsp;dictates how frequently the value of the push-button will be sent from the board to Adafruit IO.

For this example, you will configure the push button's value to be only sent when the value changes (i.e. when it's either pressed or depressed).

![](https://cdn-learn.adafruit.com/assets/assets/000/134/619/medium800/adafruit_products_Screenshot_2025-01-23_at_02.09.54.png?1737600367)

Finally, check the&nbsp; **Specify Pin Pull Direction&nbsp;** checkbox and select the pull direction.

Make sure the form's settings look like the following screenshot. Then, click&nbsp; **Create Component**.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/621/medium800/adafruit_products_Screenshot_2025-01-23_at_02.10.25.png?1737600461)

Adafruit IO sends a command to your WipperSnapper board, telling it to configure the GPIO pin you selected to behave as a digital input pin and to enable it to pull up the internal resistor.

Your board's page should also show the new push-button component.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/617/medium800/adafruit_products_Screenshot_2025-01-23_at_02.11.53.png?1737599782)

Push the button on your board to change the value of the push-button component on Adafruit IO.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/942/medium800thumb/adafruit_products_2025-01-3101-59-22-ezgif.com-video-to-gif-converter.jpg?1738289006)

# Adafruit ESP32-C6 Feather

## NeoPixel LED

Your board has a WS281x RGB LED (NeoPixel, in Adafruit jargon) built in. Boards running the WipperSnapper firmware can be wirelessly controlled by Adafruit IO to interact with NeoPixels.

On this page, you'll learn how to change the color and brightness of the NeoPixel built into your board from Adafruit IO.

## Where is the NeoPixel on my board?
Located between the buttons and the ESP32-C6 module is the square 5mm NeoPixel (RGB LED), highlighted here in red.

It's initially used to flash the changes in board status while connecting, but after the device comes online it can be used for whatever you like by simply adding the NeoPixel component to your device.

![adafruit_products_leds.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/650/medium640/adafruit_products_leds.jpg?1737735224)

## Create the NeoPixel Component
Primary: If you used the Magic Config button to automatically configure the components on your board, then the NeoPixel component will already be configured. Skip ahead to the **Usage** section.

Don't know about Magic Config? Click the Auto-Config button on the device page for further details!

On the device page, click the New Component (or "+") button to open the component picker.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/657/medium800/adafruit_products_C6_New_Component.png?1737736069)

Search for the component name by entering&nbsp;`neopixel`&nbsp;into the text box on the component picker, the list of components should update as soon as you stop typing

![neopixel_led__built_in__NaP8Tyf3AP.png](https://cdn-learn.adafruit.com/assets/assets/000/127/434/medium640/neopixel_led__built_in__NaP8Tyf3AP.png?1706807288)

### Filtering and searching for components

Since WipperSnapper supports such a large number of components, you can use keyword filtering. Try searching for various keywords, like:

- component names:&nbsp;`aht20`,&nbsp;`servo`,&nbsp;`buzzer`,&nbsp;`button`, `neopixel`, etc
- sensor types:&nbsp;`light`,&nbsp;`temperature`,&nbsp;`pressure`,&nbsp;`humidity`, etc
- interface:&nbsp;`i2c`,&nbsp;`uart`,&nbsp;`ds18x20`,&nbsp;`pin`, etc (also I2C addresses e.g.&nbsp;`0x44`)
- vendor:&nbsp;`Adafruit`,&nbsp;`ASAIR`,&nbsp;`Infineon`,&nbsp;`Bosch`,&nbsp;`Honeywell`,&nbsp;`Sensirion`, etc

There is also added product and documentation links for every component, follow the links beneath the component descriptions to be taken to the appropriate product page or Learn Guide

Select the **NeoPixel** &nbsp;from the list of results to go to the component configuration page.

There will be a back button if you select the wrong component, and you can use the Edit component icon (⚙️) on the device page to update the component configuration in the future.

![neopixel_led__built_in__NaP8Tyf3AP.png](https://cdn-learn.adafruit.com/assets/assets/000/127/447/medium640/neopixel_led__built_in__NaP8Tyf3AP.png?1706818377)

The board NeoPixel pin is automatically found and selected.

Warning: The ESP32-C6 doesn't have many pins available, so the Feather-C6 shares the IO9 pin with the on-board Boot button **and** the NeoPixel. You will only be able to add/use one component on pin IO9 at a time.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/658/medium800/adafruit_products_BtpJVYclBE.png?1737736563)

Click&nbsp; **Create Component**

Behind the scenes, Adafruit IO sends a command to your board running WipperSnapper firmware telling it to configure the pin as a NeoPixel component with the settings from the form.

The Device page shows the NeoPixel component.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/659/medium800/adafruit_products_Screenshot_%289%29.png?1737736733)

## Set the NeoPixel's RGB Color

Since no colors have been set yet, the color picker's default value is `#000000` (black in hex color code) and appears "off". You can change that to make the NeoPixel shine brightly!&nbsp;

On the NeoPixel component, click the color dropper at the end of the color swatch list.

![](https://cdn-learn.adafruit.com/assets/assets/000/127/438/medium800/neopixel_led__built_in__gU5CxAW05e_ARROW.png?1706808192)

A color picker pops open! Next: learning how Adafruit IO uses hex color codes to represent the colors on your NeoPixel.

![](https://cdn-learn.adafruit.com/assets/assets/000/118/313/medium800/neopixel_led__built_in__picker-no-color-set.png?1675876687)

### Hex Colors 101

The color picker on Adafruit IO uses hex color codes to represent Red, Green, and Blue values. For example, `#FF0000` is the hex color code for the color red. The colors (`#FF0000`) red component is `FF` (255 translated to decimal), the green component is `00` and the blue component is `00`. Translated to RGB format, the color is `RGB (255, 0, 0)`.&nbsp;

Using the color picker, or by manually entering a hex color code, select a color.

![](https://cdn-learn.adafruit.com/assets/assets/000/117/677/medium800thumb/neopixel_led_ezgif.com-gif-maker_%283%29.jpg?1674668859)

When you're ready to set the color of your device's NeoPixel, click **FILL WITH COLOR**.&nbsp;The NeoPixel will immediately glow!

![](https://cdn-learn.adafruit.com/assets/assets/000/139/433/medium800thumb/adafruit_products_20250903_190018-ezgif.com-optimize.jpg?1756924743)

## Set NeoPixel Brightness

If the NeoPixel is too bright (or too dim), you can change the overall brightness. Click the gear/cog icon on the NeoPixel component to open its settings.

![](https://cdn-learn.adafruit.com/assets/assets/000/127/439/medium800/neopixel_led__built_in__arrow_FTzWrYk8MV.png?1706810370)

On the NeoPixel component form, set Brightness to a value between 0 (fully off) and 255 (full brightness).

Click the **Update Component&nbsp;** button to send the updated configuration to your device.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/117/675/medium800/neopixel_led_IO_-_Device__Adafruit_Feather_ESP32_V2.png?1674666662)

# Adafruit ESP32-C6 Feather

## Analog Input

Your microcontroller board has both digital and analog signal capabilities. Some pins are analog, some are digital, and some are capable of both. Check the **Pinouts** page in this guide for details about your board.

Analog signals are different from digital signals in that they can be _any_ voltage and can vary continuously and smoothly between voltages. An analog signal is like a dimmer switch on a light, whereas a digital signal is like a simple on/off switch.&nbsp;

Digital signals only can ever have two states, they are either are **on** (high logic level voltage like 3.3V) or **off** (low logic level voltage like 0V / ground).

By contrast, analog signals can be any voltage in-between on and off, such as 1.8V or 0.001V or 2.98V and so on.

![](https://cdn-learn.adafruit.com/assets/assets/000/102/411/medium800/analog_in_Analog_Template_analog.jpg?1622144011)

Analog signals are continuous values which means they can be an _infinite_ number of different voltages. Think of analog signals like a floating point or fractional number, they can smoothly transiting to _any_ in-between value like 1.8V, 1.81V, 1.801V, 1.8001V, 1.80001V and so forth to infinity.

Many devices use analog signals, in particular sensors typically output an analog signal or voltage that varies based on something being sensed like light, heat, humidity, etc.

## Analog to Digital Converter (ADC)

An analog-to-digital-converter, or ADC, is the key to reading analog signals and voltages with a microcontroller. An ADC is a device that reads the voltage of an analog signal and converts it into a digital, or numeric, value. The microcontroller can’t read analog signals directly, so the analog signal is first converted into a numeric value by the ADC.&nbsp;

The black line below shows a digital signal over time, and the red line shows the converted analog signal over the same amount of time.

![](https://cdn-learn.adafruit.com/assets/assets/000/102/412/medium800/analog_in_Analog_Template_ADC.jpg?1622144080)

Once that analog signal has been converted by the ADC, the microcontroller can use those digital values any way you like!

## Potentiometers

A potentiometer is a small variable resistor that you can twist a knob or shaft to change its resistance. It has three pins. By twisting the knob on the potentiometer you can change the resistance of the middle pin (called the wiper) to be anywhere within the range of resistance of the potentiometer.

By wiring the potentiometer to your board in a special way (called a voltage divider) you can turn the change in resistance into a change in voltage that your board’s analog to digital converter can read.

![](https://cdn-learn.adafruit.com/assets/assets/000/102/413/medium800/analog_in_Analog_Template_potentiometer.jpg?1622144123)

To wire up a potentiometer as a voltage divider:

- Connect **one outside pin** to **ground**
- Connect **the other outside pin** to **voltage in (e.g. 3.3V)**
- Connect **the middle pin** to **an analog pin (e.g. A0)**

![analog_in_Analog_template_pot_voltage_divider.jpg](https://cdn-learn.adafruit.com/assets/assets/000/102/481/medium640/analog_in_Analog_template_pot_voltage_divider.jpg?1622481955)

## Hardware

In addition to your microcontroller board, you will need the following hardware to follow along with this example.

 **Potentiometer**

### STEMMA Wired Potentiometer Breakout Board - 10K ohm Linear

[STEMMA Wired Potentiometer Breakout Board - 10K ohm Linear](https://www.adafruit.com/product/4493)
For the easiest way possible to measure twists, turn to this STEMMA potentiometer breakout (ha!). This plug-n-play pot comes with a JST-PH 2mm connector and a matching &nbsp;[JST PH 3-Pin to Male Header Cables - 200mm](https://www.adafruit.com/product/3893), so wiring up is a cinch....

Out of Stock
[Buy Now](https://www.adafruit.com/product/4493)
[Related Guides to the Product](https://learn.adafruit.com/products/4493/guides)
![Video of a white hand turning the knob on a STEMMA Wired Potentiometer Breakout Board connect to a breadboard. Color changes when the knob is twisted. ](https://cdn-shop.adafruit.com/product-videos/640x480/4493-04.jpg)

## Wire Up the Potentiometer

Connect the potentiometer to your board as follows.

- **Feather 3.3V&nbsp;** to **&nbsp;potentiometer left pin**
- **Feather A2&nbsp;** to **&nbsp;potentiometer middle pin**
- **Feather GND&nbsp;** to **&nbsp;potentiometer right pin**

**Note:** &nbsp;On WipperSnapper, one of the ESP32's ADCs are unusable for analog input since WiFi is constantly running and sharing the pins. Check the Pinout Diagram for more info.

![adafruit_products_feather_ESP32-C6_Analog_Potentiometer_A2_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/134/663/medium640/adafruit_products_feather_ESP32-C6_Analog_Potentiometer_A2_bb.png?1737737527)

## Create a Potentiometer Component on Adafruit IO

On the device page, click the New Component (or "+") button to open the component picker.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/664/medium800/adafruit_products_C6_New_Component.png?1737737585)

Search for the component name by entering `potentiometer`&nbsp;into the text box on the component picker, the list of components should update as soon as you stop typing.

![analog_in__pot___N0AyUqauwx.png](https://cdn-learn.adafruit.com/assets/assets/000/128/616/medium640/analog_in__pot___N0AyUqauwx.png?1709746646)

### Filtering and searching for components

Since WipperSnapper supports such a large number of components, there is keyword filtering. Try searching for various keywords, like:

- component names: `aht20`,&nbsp;`servo`,&nbsp;`buzzer`,&nbsp;`button`,&nbsp;`potentiometer`, etc
- sensor types:&nbsp;`light`,&nbsp;`temperature`,&nbsp;`pressure`,&nbsp;`humidity`, etc
- interface:&nbsp;`i2c`,&nbsp;`uart`,&nbsp;`ds18x20`,&nbsp;`pin`, etc (also I2C addresses e.g.&nbsp;`0x44`)
- vendor:&nbsp;`Adafruit`,&nbsp;`ASAIR`,&nbsp;`Infineon`,&nbsp;`Bosch`,&nbsp;`Honeywell`,&nbsp;`Sensirion`, etc

There are also added product and documentation links for every component, follow the links beneath the component descriptions to be taken to the appropriate product page or Learn Guide.

Select the&nbsp; **Potentiometer** &nbsp;from the list of results to go to the component configuration page.

There will be a back button if you select the wrong component, and you can use the Edit component icon (⚙️) on the device page to update the component configuration in the future.

![analog_in__pot___N0AyUqauwx.png](https://cdn-learn.adafruit.com/assets/assets/000/128/617/medium640/analog_in__pot___N0AyUqauwx.png?1709746737)

On the _Create Potentiometer Component_ form:

- Set&nbsp; **Potentiometer Pin** &nbsp;to&nbsp; **A2**

- Select **"On Change"** as the **Return Interval**
- Select **Raw Analog Value** as the **Return Type**

Then, click Create Component

![](https://cdn-learn.adafruit.com/assets/assets/000/134/665/medium800/adafruit_products_hNswsjS7XQ.png?1737737734)

The potentiometer component appears on your board page! Next, learning to read values from it.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/666/medium800/adafruit_products_ieX0NDUvrt.png?1737737879)

## Read Analog Pin Values

Rotate the potentiometer to see the value change.

![](https://cdn-learn.adafruit.com/assets/assets/000/118/240/medium800thumb/analog_in__pot___ezgif.com-video-to-gif.jpg?1675792293)

_What do these values mean?_

WipperSnapper reports ADC "raw values" as 16-bit unsigned integer values. Your potentiometer will read between 0 (twisting the pot to the leftmost position) and 65535 (twisting the pot to the rightmost position).&nbsp;

## Read Analog Pin Voltage Values

You can update the potentiometer component (or any analog pin component in WipperSnapper) to report values in Volts. To do this, on the right-hand side of the potentiometer component, click the cog button.

![](https://cdn-learn.adafruit.com/assets/assets/000/118/241/medium800/analog_in__pot___cog-click.png?1675792568)

Under **Return Type** , click Voltage.

Click Update Component to send the updated component settings to your board running WipperSnapper.

![](https://cdn-learn.adafruit.com/assets/assets/000/118/242/medium800/analog_in__pot___voltage-select.png?1675792603)

Now, twist the potentiometer to see the value reported to Adafruit IO in Volts!

![](https://cdn-learn.adafruit.com/assets/assets/000/118/243/medium800thumb/analog_in__pot___ezgif.com-video-to-gif_%281%29.jpg?1675792716)

# Adafruit ESP32-C6 Feather

## I2C Sensor

Info: 

Inter-Integrated Circuit, aka **I2C** , is a two-wire protocol for connecting sensors and "devices" to a microcontroller. A large number of sensors, including the ones sold by Adafruit, use I2C to communicate.&nbsp;

**Typically, using I2C with a microcontroller involves programming. Adafruit IO and WipperSnapper let you configure a microcontroller to read data from an I2C sensor and publish that data to the internet without writing code.**

The WipperSnapper firmware supports a number of I2C sensors,&nbsp;[viewable in list format here](https://github.com/adafruit/Wippersnapper_Components/tree/main/components/i2c).

- If you do not see the I2C sensor you're attempting to use with WipperSnapper,&nbsp;[Adafruit has a guide on adding a component to Adafruit IO WipperSnapper here](https://learn.adafruit.com/how-to-add-a-new-component-to-adafruit-io-wippersnapper).&nbsp;

On this page, you'll learn how to wire up an I2C sensor to your board. Then, you'll create a new component on Adafruit IO for your I2C sensor and send the sensor values to Adafruit IO. Finally, you'll learn how to locate, interpret, and download the data produced by your sensors.

## Parts

You will need the following parts to complete this page:

### Adafruit MCP9808 High Accuracy I2C Temperature Sensor Breakout

[Adafruit MCP9808 High Accuracy I2C Temperature Sensor Breakout](https://www.adafruit.com/product/5027)
The MCP9808 digital temperature sensor is one of the more accurate/precise we've ever seen, with a typical accuracy of ±0.25°C over the sensor's -40°C to +125°C range and precision of +0.0625°C. They work great with any microcontroller using standard I2C. With...

Out of Stock
[Buy Now](https://www.adafruit.com/product/5027)
[Related Guides to the Product](https://learn.adafruit.com/products/5027/guides)
![Top view of temperature sensor breakout above an OLED display FeatherWing. The OLED display reads "MCP9808 Temp: 24.19ºC"](https://cdn-shop.adafruit.com/640x480/5027-04.jpg)

### STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long

[STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long](https://www.adafruit.com/product/4210)
This 4-wire cable is a little over 100mm / 4" long and fitted with JST-SH female 4-pin connectors on both ends. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/4210)
[Related Guides to the Product](https://learn.adafruit.com/products/4210/guides)
![Angled shot of STEMMA QT / Qwiic JST SH 4-pin Cable.](https://cdn-shop.adafruit.com/640x480/4210-00.jpg)

## Wiring
If you're using a STEMMA QT to STEMMA QT cable:

- **Board STEMMA QT Port** &nbsp;to&nbsp; **MCP9808's STEMMA QT Port**

If you're using a breadboard:

- **Board power&nbsp;** to **&nbsp;MCP9808 VIN**
- **Board ground&nbsp;** to **&nbsp;MCP9808 GND**
- **Board SCL&nbsp;** to **&nbsp;MCP9808 SCL**
- **Board SDA&nbsp;** to **&nbsp;MCP9808 SDA**

![adafruit_products_i2cScan_(2)_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/134/668/medium640/adafruit_products_i2cScan_%282%29_bb.png?1737738248)

![adafruit_products_feather_ESP32-C6_MCP9808_breadboard_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/134/669/medium640/adafruit_products_feather_ESP32-C6_MCP9808_breadboard_bb.png?1737738281)

## Add an MCP9808 Component

On the device page, click the New Component (or "+") button to open the component picker.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/670/medium800/adafruit_products_C6_New_Component.png?1737738298)

Search for the component name by entering `MCP9808`&nbsp;into the text box on the component picker, the list of components should update as soon as you stop typing.

![i2c__external__ARROW_YHKeButdWT.png](https://cdn-learn.adafruit.com/assets/assets/000/127/456/medium640/i2c__external__ARROW_YHKeButdWT.png?1706830517)

### Filtering and searching for components

Since WipperSnapper supports such a large number of components, there is keyword filtering. Try searching for various keywords, like:

- component names:&nbsp;`aht20`,&nbsp;`servo`,&nbsp;`buzzer`,&nbsp;`button`,&nbsp;`potentiometer`, etc
- sensor types:&nbsp;`light`,&nbsp;`temperature`,&nbsp;`pressure`,&nbsp;`humidity`, etc
- interface:&nbsp;`i2c`,&nbsp;`uart`,&nbsp;`ds18x20`,&nbsp;`pin`, etc (also I2C addresses e.g.&nbsp;`0x44`)
- vendor:&nbsp;`Adafruit`,&nbsp;`ASAIR`,&nbsp;`Infineon`,&nbsp;`Bosch`,&nbsp;`Honeywell`,&nbsp;`Sensirion`, etc

There are added product and documentation links for every component, follow the links beneath the component descriptions to be taken to the appropriate product page or Learn Guide.

Select the&nbsp; **MCP9808** &nbsp;from the list of results to go to the component configuration page.

There will be a back button if you select the wrong component, and you can use the Edit component icon (⚙️) on the device page to update the component configuration in the future.

![i2c__external__ARROW_YHKeButdWT.png](https://cdn-learn.adafruit.com/assets/assets/000/127/457/medium640/i2c__external__ARROW_YHKeButdWT.png?1706830625)

On the component configuration page, the MCP9808's I2C sensor address should be listed along with the sensor's settings.

![](https://cdn-learn.adafruit.com/assets/assets/000/117/981/medium800/i2c__external__mcp9808-form.png?1675199307)

The MCP9808 sensor can measure ambient temperature. This page has individual options for reading the ambient temperature, in either Celsius or Fahrenheit. You may select the readings which are appropriate to your application and region.

The&nbsp; **Send Every** &nbsp;option is specific to each sensor measurement. This option will tell the board how often it should read from the sensor and send the data to Adafruit IO. Measurements can range from every 30 seconds to every 24 hours.

For this example, set the&nbsp; **Send Every&nbsp;** interval for both seconds to&nbsp; **Every 30 seconds.&nbsp;** Click&nbsp; **Create Component**.

![](https://cdn-learn.adafruit.com/assets/assets/000/117/982/medium800/i2c__external__mcp9808-form-2.png?1675199314)

The board page should now show the MCP9808 component you created. After the interval you configured elapses, the WipperSnapper firmware running on your board automatically reads values from the sensor and sends them to Adafruit IO.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/675/medium800/adafruit_products_Screenshot_2025-01-24_170713.png?1737738524)

## Read I2C Sensor Values

Now to look behind the scenes at a powerful element of using Adafruit IO and WipperSnapper. When a new component is created on Adafruit IO, an&nbsp;[Adafruit IO Feed](https://learn.adafruit.com/adafruit-io-basics-feeds)&nbsp;is also created. This Feed holds your sensor component values for long-term storage (30 days of storage for Adafruit IO Free and 60 days for Adafruit IO Plus plans).

Aside from holding the&nbsp; **values** &nbsp;read by a sensor, the component's feed also holds&nbsp; **metadata** &nbsp;about the data pushed to Adafruit IO. This includes settings for whether the data is public or private, what license the stored sensor data falls under, and a general description of the data.

Next, to look at the sensor temperature feed. To navigate to a component's feed, click on the chart icon in the upper-right-hand corner of the component.

![](https://cdn-learn.adafruit.com/assets/assets/000/117/984/medium800/i2c__external__chart-icon.png?1675199374)

On the component's feed page, you'll each data point read by your sensor and when they were reported to Adafruit IO.

![](https://cdn-learn.adafruit.com/assets/assets/000/117/985/medium800/i2c__external__mcpx-feed.png?1675199406)

### Doing more with your sensor's Adafruit IO Feed

This only scratches the surface of what Adafruit IO Feeds can accomplish for your IoT projects. For a complete overview of Adafruit IO Feeds, including tasks like downloading feed data, sharing a feed, removing erroneous data points from a feed, and more,&nbsp;[head over to the "Adafruit IO Basics: Feed" learning guide](https://learn.adafruit.com/adafruit-io-basics-feeds).

# Adafruit ESP32-C6 Feather

## Battery Monitor (MAX17048)

There are two ways to power your Feather:

1) Power with a USB Cable connected to a power source.

2) Connect&nbsp;a 4.2/3.7V Lithium Polymer (LiPo/LiPoly) or Lithium Ion (LiIon) battery to the JST jack. This lets you run the Feather without wires, untethered.

If you're running off of a battery, chances are you want to know what the voltage is. That way you can tell when the battery needs recharging.&nbsp;

**In this section, you'll connect a battery to your Feather, and configure a battery monitor component from Adafruit IO to report the board's battery voltage and charge percentage.&nbsp;**

## Where is the Battery Monitor on my Feather?
The Feather's _&nbsp;MAX17048 Battery Monitor_&nbsp;is located directly above the STEMMA port, highlighted in pink.

![battery_monitor__lc709203f__feather-s2-batt-mon.png](https://cdn-learn.adafruit.com/assets/assets/000/118/444/medium640/battery_monitor__lc709203f__feather-s2-batt-mon.png?1676309998)

## Powering the Feather with a Battery
![](https://cdn-learn.adafruit.com/assets/assets/000/118/445/medium800/battery_monitor__lc709203f__adafruit_products_52288010178_70e2ded90a_o.jpg?1676310073)

Warning: 

You can plug any 250mAh or larger 3.7/4.2V Lipoly battery into the JST 2-PH port (identified in the diagram below) to power your Feather and charge the battery. The battery will charge from the USB power when USB is plugged in. If the battery is plugged in&nbsp;_and USB is plugged in_, the Feather will power itself from USB&nbsp;_and_ charge the battery up.

For more information about powering your Feather, visit the [Power Management Page in this guide](https://learn.adafruit.com/adafruit-esp32-s2-feather/power-management).

Primary: If you used the Magic Config button to automatically configure the components on your board, then the Battery Monitor component will already be configured. Skip ahead to the **Usage** section.

Don't know about Magic Config? Click the Auto-Config button on the device page for further details!

## Add Battery Monitor Component to Adafruit IO

From your device page, click the New Component (or +) button.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/676/medium800/adafruit_products_C6_New_Component.png?1737738625)

Search for the component name by entering&nbsp;`MAX17048`&nbsp;into the text box on the component picker, the list of components should update as soon as you stop typing.

![battery_monitor__max17048__LNHZlT3rvk-arrows.png](https://cdn-learn.adafruit.com/assets/assets/000/128/853/medium640/battery_monitor__max17048__LNHZlT3rvk-arrows.png?1711106442)

### Filtering and searching for components

Since WipperSnapper supports such a large number of components, there is keyword filtering. Try searching for various keywords, like:

- component names:&nbsp;`aht20`,&nbsp;`servo`,&nbsp;`buzzer`,&nbsp;`button`,&nbsp;`max17048`, etc
- sensor types:&nbsp;`light`,&nbsp;`temperature`,&nbsp;`pressure`,&nbsp;`humidity`, etc
- interface:&nbsp;`i2c`,&nbsp;`uart`,&nbsp;`ds18x20`,&nbsp;`pin`, etc (also I2C addresses e.g.&nbsp;`0x44`)
- vendor:&nbsp;`Adafruit`,&nbsp;`ASAIR`,&nbsp;`Infineon`,&nbsp;`Bosch`,&nbsp;`Honeywell`,&nbsp;`Sensirion`, etc

There are added product and documentation links for every component, follow the links beneath the component descriptions to be taken to the appropriate product page or Learn Guide.

Select the&nbsp; **MAX17048** &nbsp;from the list of results to go to the component configuration page.

There will be a back button if you select the wrong component, and you can use the Edit component icon (⚙️) on the device page to update the component configuration in the future.

![battery_monitor__max17048__LNHZlT3rvk-arrows.png](https://cdn-learn.adafruit.com/assets/assets/000/128/855/medium640/battery_monitor__max17048__LNHZlT3rvk-arrows.png?1711106727)

The Create Component form should load, used for component configuration, with the MAX17048's I2C sensor address listed along with the sensor's settings.

On the _Create MAX17048 Component_ form, there are two options:

1. Enable the battery cell voltage reading. This will cause the Feather to report the status of its battery expressed in Volts.
2. Enable the battery cell percent reading. This will cause the Feather to report the status of its battery expressed as a percent.&nbsp;

Then, the battery measurement will be read and sent to Adafruit IO every "Send Every" period.

In the screenshot below, the battery monitor is configured to report its battery cell voltage _and_ battery cell percentage back to Adafruit IO every 30 seconds.

After configuring the MAX17048 component, click _Create Component._

![](https://cdn-learn.adafruit.com/assets/assets/000/118/461/medium800/battery_monitor__max17048__max_2.png?1676327561)

Every 30 seconds, the Feather uses the MAX17048 component to measure its battery cell percent and voltage, and report it back to Adafruit IO.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/677/medium800/adafruit_products_Screenshot_2025-01-24_171357.png?1737738855)

## Going Further

Now that you have a battery monitor component set up on Adafruit IO, you may [follow this guide to configure an Adafruit IO Action for receiving an SMS text message when your Feather's battery level is below a threshold](https://learn.adafruit.com/no-code-battery-monitoring-with-wippersnapper/battery-level-sms-alert-with-adafruit-io-actions).

# Adafruit ESP32-C6 Feather

## Factory Reset

Your microcontroller ships running a factory demo. It's lovely, but you probably had other plans for the board. As you start working with your board, you may want to return to the original code to begin again, or you may find your board gets into a bad state. Either way, this page has you covered.

## Factory Reset Example Code
If you're still able to load Arduino sketches, you can load the following sketch onto your board to return it to its original state.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Factory_Tests/Adafruit_ESP32-C6_Feather_FactoryTest/Adafruit_ESP32-C6_Feather_FactoryTest.ino

Your board is now back to its factory-shipped state! You can now begin again with your plans for your board.

## Factory Reset .bin
If your board is in a state where Arduino isn't working, you may need to use these tools to flash a .bin file directly onto your board.

There are two ways to do a factory reset. The first is using WebSerial through a Chromium-based browser, and the second is using `esptool` via command line. **We highly recommend using WebSerial through Chrome/Chromium.**

First you'll need to download the factory-reset.bin file. Save the following file wherever is convenient for you. You'll need access to it for both tools.

[Click to download the ESP32-C6 Feather Factory Reset .BIN File](https://github.com/adafruit/Adafruit-ESP32-C6-Feather-PCB/raw/main/factory-reset/Adafruit_ESP32-C6_Feather_FactoryReset.bin)
Now that you've downloaded the .bin file, you're ready to continue with the factory reset process. The next two sections walk you through using WebSerial and `esptool`.

## The WebSerial ESPTool Method
Primary: 

This method uses the WebSerial ESPTool through Chrome or a Chromium-based browser. The WebSerial ESPTool was designed to be a web-capable option for programming ESP32 boards. It allows you to erase the contents of the microcontroller and program up to four files at different offsets.

You will have to use a Chromium browser (like Chrome, Opera, Edge...) for this to work, Safari and Firefox, etc. are _not_ supported because we need Web Serial and only Chromium is supporting it to the level needed.

Follow the steps to complete the factory reset.

Warning: 

### Connect

You should have plugged in **only the ESP32 that you intend to flash**. That way there's no confusion in picking the proper port when it's time!

In the **Chrome browser** visit [https://adafruit.github.io/Adafruit\_WebSerial\_ESPTool/](https://adafruit.github.io/Adafruit_WebSerial_ESPTool/). You should see something like the image shown.

![esp32_factory_reset_Screen_Shot_2022-04-04_at_3.07.03_PM.png](https://cdn-learn.adafruit.com/assets/assets/000/110/492/medium640/esp32_factory_reset_Screen_Shot_2022-04-04_at_3.07.03_PM.png?1649110083)

Press the&nbsp; **Connect** &nbsp;button in the top right of the web browser. You will get a pop up asking you to select the COM or Serial port.

**Remember, you should remove all other USB devices so**  **_only_ the ESP32 board is attached, that way there's no confusion over multiple ports!**

On some systems, such as MacOS, there may be additional system ports that appear in the list.

![esp32_factory_reset_Screen_Shot_2022-04-04_at_3.12.49_PM.png](https://cdn-learn.adafruit.com/assets/assets/000/110/493/medium640/esp32_factory_reset_Screen_Shot_2022-04-04_at_3.12.49_PM.png?1649110453)

The Javascript code will now try to connect to the ROM bootloader. It may timeout for a bit until it succeeds. On success, you will see that it is&nbsp; **Connected** &nbsp;and will print out a unique&nbsp; **MAC address** identifying the board along with other information that was detected.

![esp32_factory_reset_Screen_Shot_2022-04-04_at_3.16.00_PM.png](https://cdn-learn.adafruit.com/assets/assets/000/110/494/medium640/esp32_factory_reset_Screen_Shot_2022-04-04_at_3.16.00_PM.png?1649110590)

&nbsp;

&nbsp;

Once you have successfully connected, the command toolbar will appear.

![esp32_factory_reset_Screen_Shot_2022-04-04_at_3.18.26_PM.png](https://cdn-learn.adafruit.com/assets/assets/000/110/496/medium640/esp32_factory_reset_Screen_Shot_2022-04-04_at_3.18.26_PM.png?1649110775)

### Erase the Contents
To erase the contents, click the Erase button. You will be prompted whether you want to continue. Click OK to continue or if you changed your mind, just click cancel.

![esp32_factory_reset_Screen_Shot_2022-04-04_at_3.19.58_PM.png](https://cdn-learn.adafruit.com/assets/assets/000/110/497/medium640/esp32_factory_reset_Screen_Shot_2022-04-04_at_3.19.58_PM.png?1649110871)

&nbsp;

You'll see "Erasing flash memory. Please wait..." This will eventually be followed by "Finished." and the amount of time it took to erase.

**Do not disconnect!** Immediately continue on to programming the ESP32.

![factory_reset___esp32_s2_WebSerial_ESPTool_erase_board_text.png](https://cdn-learn.adafruit.com/assets/assets/000/106/947/medium640/factory_reset___esp32_s2_WebSerial_ESPTool_erase_board_text.png?1638491869)

Danger: 

### Program the ESP32
Programming the microcontroller can be done with up to four files at different locations, but with the board-specific **factory-reset.bin** file, which you should have downloaded earlier, you only need to use one file.

Click on the first **Choose a file...**. (The tool will only attempt to program buttons with a file and a unique location.) Then, select the \*- **factory-reset.bin** file you downloaded in Step 1 that matches your board.

Verify that the&nbsp; **Offset** &nbsp;box next to the file location you used is (0x) **0**.

![install_uf2_bootloader_adafruit_products_image_(3).png](https://cdn-learn.adafruit.com/assets/assets/000/101/574/medium640/install_uf2_bootloader_adafruit_products_image_%283%29.png?1618608677)

Once you choose a file, the button text will change to match your filename. You can then select the **Program** button to begin flashing.

![esp32_factory_reset_Screen_Shot_2022-04-04_at_3.22.13_PM.png](https://cdn-learn.adafruit.com/assets/assets/000/110/500/medium640/esp32_factory_reset_Screen_Shot_2022-04-04_at_3.22.13_PM.png?1649111131)

A progress bar will appear and after a minute or two, you will have written the firmware.

![esp32_factory_reset_Screen_Shot_2022-04-04_at_3.23.42_PM.png](https://cdn-learn.adafruit.com/assets/assets/000/110/499/medium640/esp32_factory_reset_Screen_Shot_2022-04-04_at_3.23.42_PM.png?1649111082)

Once completed, you can skip down to the section titled Reset the Board.

## The `esptool` Method (for advanced users)
Danger: 

Alternatively, you can [use Espressif's esptool program](https://github.com/espressif/esptool)&nbsp;to communicate with the chip!&nbsp;`esptool`&nbsp;is the 'official' programming tool and is the most common/complete way to program an ESP chip.

### Install ESPTool.py

You will need to use the command line / Terminal to install and run&nbsp;`esptool`.

You will also need to have pip and Python installed (any version!).

Install the latest version using pip (you may be able to run&nbsp;`pip`&nbsp;without the&nbsp;`3`&nbsp;depending on your setup):

`pip3 install --upgrade esptool`

Then, you can run:

`esptool.py`

### Test the Installation

Run&nbsp;`esptool.py`&nbsp;in a new terminal/command line and verify you get something like the below:

![](https://cdn-learn.adafruit.com/assets/assets/000/109/599/medium800/esp32_factory_reset_ESP_factory_reset_esptool_verify.png?1646862954)

### Connect

Run the following command, replacing the `COM88` identifier after&nbsp;`--port`&nbsp;with the&nbsp;`COMxx`,&nbsp;`/dev/cu.usbmodemxx`&nbsp;or&nbsp;`/dev/ttySxx`&nbsp;you found above.

`esptool.py --port COM88 chip_id`

You should get a notice that it connected over that port and found an ESP32.

![](https://cdn-learn.adafruit.com/assets/assets/000/109/600/medium800/esp32_factory_reset_ESP_factory_reset_esptool_connect.png?1646862962)

### Installing the Factory Test file

Run this command and replace the serial port name, `COM88`, with your matching port and `*-factory-reset.bin` with file you just downloaded

`esptool.py --port COM88 write_flash 0x0 *-factory-reset.bin`

Don't forget to change the `--port` name to match.

There might be a bit of a 'wait' when programming, where it doesn't seem like it's working. Give it a minute, it has to erase the old flash code which can cause it to seem like it's not running.

You'll finally get an output like this:

![](https://cdn-learn.adafruit.com/assets/assets/000/109/601/medium800/esp32_factory_reset_ESP_factory_reset_esptool_install.png?1646862974)

Once completed, you can continue to the next section.

## Reset the board
Now that you've reprogrammed the board, you need to reset it to continue. Click the reset button to launch the new firmware.

Info: 

The NeoPixel LED on the ESP32-C6 Feather will show a rainbow swirl. Every few seconds, you'll see an I2C scan print to the Serial Monitor with address 0x36 for the onboard battery monitor.

You've successfully returned your board to a factory reset state!

## Older Versions of Chrome
Primary: 

We suggest updating to Chrome 89 or newer, as Web Serial is enabled by default.

If you must continue using an older version of Chrome, follow these steps to enable Web Serial.

If you receive an error like the one shown when you visit the WebSerial ESPTool site, you're likely running an older version of Chrome.

**You must be using Chrome 78 or later to use Web Serial.**

![factory_reset___esp32_s2_WebSerial_ESPTool_Not_Supported_Error.png](https://cdn-learn.adafruit.com/assets/assets/000/106/929/medium640/factory_reset___esp32_s2_WebSerial_ESPTool_Not_Supported_Error.png?1638484333)

To enable Web Serial in Chrome versions 78 through 88:

- Visit **chrome://flags** &nbsp;from within Chrome.
- Find and enable the&nbsp; **Experimental Web Platform features**
- **Restart Chrome**

![install_uf2_bootloader_adafruit_products_Enable_Features.jpg](https://cdn-learn.adafruit.com/assets/assets/000/101/562/medium640/install_uf2_bootloader_adafruit_products_Enable_Features.jpg?1618608210)

# Adafruit ESP32-C6 Feather

## Downloads

## Files

- [ESP32-C6 datasheet](https://www.espressif.com/sites/default/files/documentation/esp32-c6-mini-1_mini-1u_datasheet_en.pdf)
- [EagleCAD PCB files on GitHub](https://github.com/adafruit/Adafruit-ESP32-C6-Feather-PCB)
- [Fritzing object in the Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library/blob/master/parts/Adafruit%20Feather%20ESP32-C6.fzpz)
- [PrettyPins pinout PDF on GitHub](https://github.com/adafruit/Adafruit-ESP32-C6-Feather-PCB/blob/main/Adafruit%20Feather%20ESP32-C6%20PrettyPins%202.pdf)
- [PrettyPins pinout SVG on GitHub](https://github.com/adafruit/Adafruit-ESP32-C6-Feather-PCB/blob/main/Adafruit%20Feather%20ESP32-C6%20PrettyPins%202.svg)

## Schematic and Fab Print
![](https://cdn-learn.adafruit.com/assets/assets/000/131/884/medium800/adafruit_products_schem.png?1723750406)

![](https://cdn-learn.adafruit.com/assets/assets/000/131/885/medium800/adafruit_products_fab.png?1723750413 dimensions are in inches)


## Primary Products

### Adafruit ESP32-C6 Feather - STEMMA QT

[Adafruit ESP32-C6 Feather - STEMMA QT](https://www.adafruit.com/product/5933)
The&nbsp;ESP32-C6&nbsp;is Espressif’s first Wi-Fi 6 SoC integrating 2.4 GHz Wi-Fi 6, Bluetooth 5 (LE) and the 802.15.4 protocol. It brings the goodness you know from the [low-cost C3 series](https://www.adafruit.com/product/5337) and improves it with Zigbee/802.15.4 at 2.4Ghz....

In Stock
[Buy Now](https://www.adafruit.com/product/5933)
[Related Guides to the Product](https://learn.adafruit.com/products/5933/guides)

## Related Guides

- [Control Wiz Lights With CircuitPython](https://learn.adafruit.com/control-wiz-lights-with-circuitpython.md)
- [Adafruit STEMMA Reflective Photo Interrupt Sensor](https://learn.adafruit.com/adafruit-stemma-reflective-photo-interrupt-sensor.md)
- [Adafruit INA228 I2C Power Monitor](https://learn.adafruit.com/adafruit-ina228-i2c-power-monitor.md)
- [Using the CircuitPython Extension for Visual Studio Code](https://learn.adafruit.com/using-the-circuitpython-extension-for-visual-studio-code.md)
- [Adafruit PN532 RFID/NFC Breakout and Shield](https://learn.adafruit.com/adafruit-pn532-rfid-nfc.md)
- [Ethernet for CircuitPython with Wiznet5K](https://learn.adafruit.com/ethernet-for-circuitpython.md)
- [Capturing Camera Images with CircuitPython](https://learn.adafruit.com/capturing-camera-images-with-circuitpython.md)
- [Adafruit KB2040](https://learn.adafruit.com/adafruit-kb2040.md)
- [Adafruit MOSFET Driver](https://learn.adafruit.com/adafruit-mosfet-driver.md)
- [Adafruit FONA 808 Cellular + GPS Shield for Arduino](https://learn.adafruit.com/adafruit-fona-808-cellular-plus-gps-shield-for-arduino.md)
- [UFO Flying Saucer with Circuit Playground Express](https://learn.adafruit.com/ufo-circuit-playground-express.md)
- [MagTag Daily Christmas Countdown](https://learn.adafruit.com/magtag-daily-christmas-countdown.md)
- [Mystery Box: Haunted Radio](https://learn.adafruit.com/mystery-box-haunted-radio.md)
- [Adafruit A4988 Stepper Motor Driver Breakout Board](https://learn.adafruit.com/adafruit-a4988-stepper-motor-driver-breakout-board.md)
- [USB Host to BLE Keyboard Adapter](https://learn.adafruit.com/esp32-s3-usb-to-ble-keyboard-adapter.md)
