Menü
Microbots
0
  • Lernen
  • Geschäft
    • Module & Technik
    • Maker-Packs
    • Werkzeuge und Ausrüstung
    • Robots & Displays
    • Alle Produkte
  • Gemeinschaft
    • Education
    • Software
  • Um
    • Unsere Geschichte
    • Kontakt
    • FAQs
  • Deutsch
  • Ihr Warenkorb ist leer
Microbots
  • Lernen
  • Geschäft
    • Module & Technik
    • Maker-Packs
    • Werkzeuge und Ausrüstung
    • Robots & Displays
    • Alle Produkte
  • Gemeinschaft
    • Education
    • Software
  • Um
    • Unsere Geschichte
    • Kontakt
    • FAQs
  • Sprache

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

  • Teilen:

Sozial

Github

  • Um
  • Software
  • Education
  • Kontakt
  • FAQs
  • Bedingungen
  • Rückerstattung-Politik
  • Datenschutzrichtlinie

Erfahren Sie als Erster von neuen Projekten und sichern Sie sich spannende Angebote!

© 2025 Microbots.