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

  • 0 0

CodeCell: C6 Drive


CodeCell C6 Drive is a tiny all-in-one robotics board that combines an ESP32-C6 microcontroller, onboard sensors and two H-bridge motor drivers. Each of the two built-in drivers (Drive 1 & Drive 2) can deliver PWM-controlled current to directly power:

  • DC Motors & Gearmotors – for small robots, rovers, or fans.
  • Actuators & Coil-Based Devices – such as CoilPad or FlatFlap.
  • High-Power LEDs – drive lighting or status indicators with smooth PWM dimming.
  • Buzzers & Haptic Actuators – create tones or vibration effects directly from the driver.

Drive Functions

Each driver channel includes several functions for different behaviors:


// 1️⃣ Initialize driver pins and timers
myCodeCell.Drive1.Init();      

// 2️⃣ Drive(direction, power_percent)
// Run the motor or load in a direction (true = forward, false = reverse)
// with PWM power level (0–100% duty cycle)
myCodeCell.Drive1.Drive(true, 80);

// 3️⃣ Tone()
// Generate a sweeping tone using PWM – ideal for audio or feedback vibration
myCodeCell.Drive1.Tone();

// 4️⃣ Pulse(direction, ms_duration)
// Apply a short directional pulse (in milliseconds) – great for flip actuators
myCodeCell.Drive1.Pulse(true, 150);

// 5️⃣ Buzz(us_buzz)
// Toggle output rapidly to create a buzzing sound
myCodeCell.Drive1.Buzz(800);

// 6️⃣ Toggle(power_percent)
// Alternate polarity at a set duty level – creates vibration patterns
myCodeCell.Drive1.Toggle(60);

// 7️⃣ Run(smooth, power_percent, flip_speed_ms)
// Periodically flip polarity for actuators (CoilPad, FlatFlap, etc.)
myCodeCell.Drive1.Run(false, 80, 200);   // Square wave (fast)
myCodeCell.Drive2.Run(true, 60, 400);    // Smooth wave (gentle flap)

Example – Proximity-Controlled Motors

This example links the onboard VCNL4040 proximity sensor with both drive outputs. As your hand moves closer, the output motors or LEDs, spin or brighten faster.


#include <CodeCell.h>

CodeCell myCodeCell;

#define PROXIMITY_RANGE 1000U
#define MOTOR_DEADZONE 30U
#define MOTOR_MAXSPEED 90U

void setup() {
  Serial.begin(115200);
  myCodeCell.Init(LIGHT);        // Enable proximity sensing

  myCodeCell.Drive1.Init();      // Initialize both drivers
  myCodeCell.Drive2.Init();

  myCodeCell.Drive1.Tone();      // Short feedback buzz
  myCodeCell.Drive2.Tone();
}

void loop() {
  if (myCodeCell.Run(10)) {      // Run at 10 Hz
    uint16_t proximity = myCodeCell.Light_ProximityRead();
    proximity = min(proximity, PROXIMITY_RANGE);

    uint8_t speed = map(proximity, 0, PROXIMITY_RANGE,
                        MOTOR_DEADZONE, MOTOR_MAXSPEED);

    myCodeCell.Drive1.Drive(true, speed);
    myCodeCell.Drive2.Drive(true, speed);

    Serial.printf("Proximity: %u | Speed: %u%%\n", proximity, speed);
  }
}

Customization Tips

  • Change Direction: Use false in Drive() to reverse rotation.
  • Tune Deadzone & Speed: Adjust MOTOR_DEADZONE and MOTOR_MAXSPEED for your motors.
  • Alternate Effects: Replace Drive() with Pulse() or Run() for rhythmic motion for flapping actuators.
  • Combine Sensors: Use motion, or gesture sensors to control drive behavior.

 

  • 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!

© 2026 Microbots.

★ Reviews

Let customers speak for us

53 reviews
Write a review
85%
(45)
4%
(2)
2%
(1)
4%
(2)
6%
(3)
21
49
G
CodeCell C6 Drive
Gerhard Weidenauer

Great board with many funktions in small space

User picture
L
MotorCell
Lennart Lange

Nice packaging, good follow up on the delivery, need to look up some online resources now for my first actual project wiht the cell

B
CodeCell C6 Drive
Brandon

Awesome product with great tutorials and example code

G
MotorCell
Gerald Kendrick

Very happy with my MotorCell. I'm incorporating it into a prototype project that will hopefully result in me needing a few more!

User picture
A
CodeCell C6 Drive
Anonymous

Great product! Having the IMU, motor driver, and battery management directly on the board is incredibly handy for quick prototyping. Love it!

Improvement ideas:
- using an ESP32 other than the C6 to get more cores. On a single-core chip, WiFi tasks often interfere with real-time applications.
- adding two more motor drivers (with a slightly higher current rating) would be awesome for drone projects!
- I know the compactness of the board is a huge selling point and really optimised, but exposing a few more pins would be great. With the motor drivers already occupying 4 pins, having only 4 GPIOs left can be tight for complex projects (though I’m nitpicking, I’m really pushing this board to its limits!).

123