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

  • 0 0

MotorCell - Pulsing a Spin

MotorCell isn't just for continuous motion - it can also be pulsed for a short bursts of movement. This is particularly useful for kinetic art projects, where controlled, rhythmic motion can create stunning visual effects. By pulsing the motor for a few milliseconds at a time, you can achieve coordinated spinning effects across multiple motors.

Why Pulse a Motor?

  • Kinetic Art Installations: Create timed, individual spins to form unique patterns and illusions.
  • Efficiency: Only running the motor when needed reduces power consumption.
  • Tactile Feedback: Short bursts of motion can simulate haptic feedback.

Pulsing Motor Example

This example demonstrates how to pulse six motors for 2000 milliseconds (2 seconds) each, creating a sequential spinning effect. The function Pulse(IN_pinX, pulse_ms) activates each motor for a set duration before moving to the next.

#include <MotorCell.h>

#define IN_pin1 1
#define IN_pin2 2
#define IN_pin3 3
#define IN_pin5 5
#define IN_pin6 6
#define IN_pin7 7

#define pulse_ms 2000

int motor_num = 0;

MotorCell myMotorCell(1,2,3);

void setup() {
}

void loop() {
  delay(100);
  motor_num++;
  switch (motor_num) {
    case 1:
       myMotorCell.Pulse(IN_pin1, pulse_ms); /* Pulse motor 1 for 2000ms */
      break;
    case 2:
       myMotorCell.Pulse(IN_pin2, pulse_ms); /* Pulse motor 2 for 2000ms */
      break;
    case 3:
       myMotorCell.Pulse(IN_pin3, pulse_ms); /* Pulse motor 3 for 2000ms */
      break;
    case 5:
       myMotorCell.Pulse(IN_pin5, pulse_ms); /* Pulse motor 5 for 2000ms */
      break;
    case 6:
       myMotorCell.Pulse(IN_pin6, pulse_ms); /* Pulse motor 6 for 2000ms */
      break;
    case 7:
       myMotorCell.Pulse(IN_pin7, pulse_ms); /* Pulse motor 7 for 2000ms */
      motor_num = 0; /* Reset the sequence */
      break;
  }
}

How This Works

  1. The motor_num variable tracks which motor is currently active.
  2. The loop increments motor_num and selects the corresponding motor.
  3. The function Pulse(IN_pinX, pulse_ms) is used to activate each motor for 2 seconds before moving to the next.
  4. The sequence resets, continuously looping the effect.

Expanding on the Effect

  • Modify Pulse Duration: Change pulse_ms to adjust the spin time of each motor.
  • Add More Motors: Expand the case structure to include additional motors.
  • Vary the Timing: Introduce random delays or different pulse durations for each motor.
  • Use Sensor Inputs: Trigger motor pulses based on sensor data for interactive installations. The CodeCell's proximity can make this super fun!

Ready to start experimenting? Grab a MotorCell today and check out the MotorCell GitHub Repository for more code examples and technical documentation!

  • 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

67 reviews
Write a review
85%
(57)
6%
(4)
1%
(1)
3%
(2)
4%
(3)
62
21
C
CodeCell C3
Cloke74

Great piece of kit, had just what i needed to complete the project i had in mind. Shame shipping to the UK is so expensive, but appreciate this isn’t necessarily in the hands of MicroBots

A
CodeCell C6
Anonymous

I had an issue, got a red light, I used too much flux. Support said clean it, then the one sensor worked fine. I got the help and answer same day I provided a foto.

A
CodeCell C6 Drive
Anonymous

I think this is the best of the ESP offered, most versatile.

User picture
P
CodeCell C6
Prudhvi tej Chinimilli

Been testing the Microbots CodeCell C6 and honestly impressed with how much functionality they packed into such a tiny module. Great form factor for rapid prototyping wearable/embedded sensing applications. ESP32-C6 + IMU integration makes development much easier compared to building everything from scratch.

Still exploring battery optimization and compact LiPo options for our use case, but overall the platform is promising for low-cost real-time sensing systems. Excited to keep building with it.

F
CodeCell C6
Francisco Estivallet

Amazing hardware, my go to for compact projects.

User picture
123