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

41 reviews
Write a review
80%
(33)
5%
(2)
2%
(1)
5%
(2)
7%
(3)
21
37
A
CodeCell C6
Anonymous

Love it

L
CoilCell
Laszlo Hasenau

Nice to have the drivers integrated, sufficient for very small units, where low force needed.

User picture
L
CodeCell C6 Drive
Leon

Love this thing! The coding for controlling the integrated drivers is extremely intuitive, the chip is fast as always and all the other sensors work like a charm. If there were 6 stars id give all of em but theres only 5 XD

A
CodeCell C6 Drive
Anonymous

Pequeno e esperto. TEM projetos com câmera 📷🎥?
DVR PARA MOTO 🛵?

A
CodeCell C3
Anonymous

Busy developing something that has been a very popular topic in the maker space. Once complete I will share it all with you including the coding.I am really impressed with the punch this little C3 packs. Really a great piece of engineering. Keep up the brilliant work and thank you for making this little giant!!!!!!

123