Menu
Microbots
0
  • Make
    • Getting Started
    • Maker Builds
    • Education
  • Shop
    • Maker-Modules
    • Maker-Packs
    • Tools & Gears
    • Robots & Displays
  • About
    • Our Story
    • Reach Out
    • FAQs
  • English
  • Your Cart is Empty
Microbots
  • Make
    • Getting Started
    • Maker Builds
    • Education
  • Shop
    • Maker-Modules
    • Maker-Packs
    • Tools & Gears
    • Robots & Displays
  • About
    • Our Story
    • Reach Out
    • FAQs
  • Language

  • 0 0

Debugging CodeCell

CodeCell is designed to be easy to set up and use, but like any microcontroller, issues can arise. This guide will help you troubleshoot and debug CodeCell effectively.

Ensure You Have the Latest Library Versions 

Before troubleshooting, make sure you’re using the latest versions of:

  • CodeCell Library → Always update to the latest version for bug fixes and improvements. 
  • ESP32C3 Board Support Package → Make sure you have the newest ESP32-C3 board definitions installed in the Arduino IDE.

To update:

  1. Open Arduino IDE and navigate to Sketch > Include Library > Manage Libraries.
  2. Search for CodeCell and install the latest version.
  3. Navigate to Tools > Board > Board Manager, search for ESP32, and update to the latest version.

Setting Up and Using CodeCell 

To make programming easier, the CodeCell library provides a variety of functions for initializing, reading, and managing sensors and power. Here’s everything you need to know about setting up your device and its library.

Unboxing Your CodeCell

Inside the box, you’ll find:

  • CodeCell: A tiny yet powerful ESP32-C3-based board with programmable GPIOs and sensors.
  • Screws: Four M1.2 x 6mm screws for mounting.
  • Headers: Three sets of female headers (soldered or unsoldered, based on your selection).
  • Battery/Cable: If purchased, a 170mAh 20C LiPo battery with a pre-soldered cable or a battery connector cable.

Powering Up CodeCell for the First Time

Plug in a USB-C cable, and CodeCell will:

  • Initialize its internal peripherals and sensors. The status is printed on the Serial Monitor and will let you know if there are any issue detected.
  • Check Power Status:
    • If no battery is connected, a breathing LED animation occurs.
    • If powered by USB, the LED flashes blue.
    • If running on battery, the LED flashes green.
    • If charging, the LED remains static blue until fully charged.

Common Power Issues & Fixes:

  • Serial Not working?
    • Check if your USB-C cable supports both power and data.
    • Ensure Tools/USB_CDC_On_Boot is enabled
    • Try a different USB port or power adapter.
  • Battery not detected?
    • Ensure the battery is properly connected and charged.

Connecting CodeCell to the Arduino IDE

Step 1: Install Arduino IDE

Download the latest version from the official Arduino website.

Step 2: Add ESP32 Board Support

  1. Open Arduino IDE and go to File > Preferences.
  2. In the 'Additional Board Manager URLs' field, enter:
    https://dl.espressif.com/dl/package_esp32_index.json
    
  3. Click OK and restart Arduino IDE.

Step 3: Select the Correct Board and Port

  1. Navigate to Tools > Board > ESP32C3 Dev Module.
  2. Select the correct COM Port under Tools > Port.
  3. Enable USB_CDC_On_Boot in Tools > USB_CDC_On_Boot.
  4. Set the CPU clock speed to 160MHz.

Step 4: Install the CodeCell Library

  1. Navigate to Sketch > Include Library > Manage Libraries.
  2. Search for CodeCell and install the latest version.
  3. Open File > Examples > CodeCell, and try the GettingStarted example.

Step 5: Upload & Run Your First Sketch

  1. Click the Upload button.
  2. Open Tools > Serial Monitor to see output from your CodeCell.

CodeCell Library & Functions

Initializing CodeCell

The first step is to initialize the CodeCell using:

myCodeCell.Init(SENSOR_MACRO);

Available Macros:

  • LIGHT → Enables Light Sensing.
  • MOTION_ACCELEROMETER → Enables Accelerometer Sensing.
  • MOTION_GYRO → Enables Gyroscope Sensing.
  • MOTION_MAGNETOMETER → Enables Magnetometer Sensing.
  • MOTION_STEP_COUNTER → Enables Step Counting.
  • MOTION_ACTIVITY → Detects Walking, Running, or Driving.

You can combine multiple macros using the + operator:

myCodeCell.Init(LIGHT + MOTION_ACCELEROMETER + MOTION_GYRO);

More Detailed Debugging 

  • CodeCell Not Detected in Arduino IDE
    • Ensure the USB-C cable supports data transfer, not just power.
    • Restart Arduino IDE and try selecting the correct COM port.
    • Check Device Manager (Windows) / System Report (Mac) to verify if CodeCell appears as a USB device.
  • Code Upload Fails
    • Make sure USB_CDC_On_Boot is enabled.
    • If CodeCell is stuck in a reset loop:
      • Short SCL (GPIO9) to GND.
      • Unplug USB and turn off battery.
      • Plug USB back in and re-upload the sketch.
      • Remove the short once reprogrammed.
  • Serial Monitor Not Showing Data
    • Ensure baud rate is set to 115200.
    • Go to Tools > USB_CDC_On_Boot and enable it.
    • Ensure the USB-C cable supports data transfer, not just power.
    • Try restarting the Serial Monitor.
  • Unexpected LED Behavior
    • 🔴 Flashing Red → Low battery (<3.3V), entering sleep mode.
    • 🔵 Static Blue → Battery charging.
    • 🟢 Breathing Green → Running on battery.
    • 🔵 Breathing Blue → Fully charged.
  • Sensors Not Responding
    •  Ensure you've initialized the correct sensor using myCodeCell.Init(SENSOR_MACRO);
    • Check the Serial Monitor this should help you identify why the sensor is not responding
    • If using external sensors avoid using I2C addresses 0x60 (VCNL4040) and 0x4A (BNO085) as there will be conflicts

Final Thoughts

Hope this has helped you identify the root cause. If you're still facing the issue, don’t hesitate to reach out - we’d be glad to help!

  • Share:

Follow

Github

  • About
  • Software
  • Education
  • Contact
  • FAQs
  • Terms
  • Refund Policy
  • Privacy Policy

Join our Community ~ Be the first to know about new products and get exciting deals!

© 2025 Microbots.