Menu
Microbots
0
  • Faire
    • Commencer
    • Constructions de créateurs
    • Éducation
  • Boutique
    • Modules Maker
    • Outils et engrenages
    • Robots et écrans
  • À propos
    • Notre histoire
    • Tendez la main
    • FAQ
  • Connexion
  • français
  • Votre panier est vide
Microbots
  • Faire
    • Commencer
    • Constructions de créateurs
    • Éducation
  • Boutique
    • Modules Maker
    • Outils et engrenages
    • Robots et écrans
  • À propos
    • Notre histoire
    • Tendez la main
    • FAQ
  • Langue

  • 0 0

FlatFlap - Créer un mouvement pulsé

FlatFlap est un actionneur compact capable de générer des mouvements de battement organiques. Cependant, ce guide se concentre sur la création d'une impulsion courte : un battement unique ne durant que quelques millisecondes avant de s'arrêter. Cette méthode est utile pour les actions rapides et les applications nécessitant un mouvement bref.

Comment ça marche

Pour générer du mouvement, FlatFlap utilise un courant électrique traversant sa bobine, créant ainsi un champ magnétique. En appliquant une courte impulsion, nous induisons un champ magnétique rapide qui repousse instantanément l'aimant.

Générer une impulsion dans Arduino

Pour générer manuellement une impulsion, vous pouvez utiliser les commandes digitalWrite de base :

 #define FLAP_PIN1 2
 #define FLAP_PIN2 3

 void setup() {
 pinMode(FLAP_PIN1, OUTPUT);
 pinMode(FLAP_PIN2, OUTPUT);
 }

 void loop() {
 digitalWrite(FLAP_PIN1, HIGH);
 digitalWrite(FLAP_PIN2, LOW);
 delay(500); // Pulse duration in milliseconds

 digitalWrite(FLAP_PIN1, LOW);
 digitalWrite(FLAP_PIN2, LOW); // Stop motion
 delay(3000); // Stop for 3 sec
 }

Ce code simple envoie une impulsion de 500 millisecondes à FlatFlap, provoquant un bref mouvement avant de s'arrêter.

Optimisation du contrôle des impulsions avec PWM

Au lieu d'une impulsion ON/OFF brutale, la modulation de largeur d'impulsion (PWM) permet de contrôler progressivement l'intensité, réduisant ainsi les contraintes mécaniques et améliorant les performances. DriveCell gère automatiquement cette fonction :

 #include <drivecell.h>

 #define IN1_pin1 2
 #define IN1_pin2 3
 DriveCell FlatFlap1(IN1_pin1, IN1_pin2);

 void setup() {
 FlatFlap1.Init();
 }

 void loop() {
 FlatFlap1.Pulse(true, 10); // Pulse forward for 10ms
 delay(500); // Wait before the next pulse
 }

Si vous utilisez notre bibliothèque DriveCell, vous pouvez directement utiliser la fonction Pulse pour implémenter ceci :

 #include <drivecell.h>

 #define IN1_pin1 2
 #define IN1_pin2 3
 DriveCell FlatFlap1(IN1_pin1, IN1_pin2);

 void setup() {
 FlatFlap1.Init();
 }

 void loop() {
 FlatFlap1.Pulse(true, 100); // Pulse for 100ms
 delay(3000); // Wait before the next pulse
 FlatFlap1.Pulse(true, 1000); // Pulse for 1000ms
 delay(3000); // Wait before the next pulse
 FlatFlap1.Pulse(true, 500); // Pulse for 500ms 
delay(3000); // Attendre avant la prochaine impulsion
 }

Comprendre la fonction :

  • Pulse(bool direction, uint8_t ms_duration)

    • direction : true (nord) / false (sud)

    • ms_duration : Durée de l'impulsion en millisecondes

Conclusion

Grâce à de courtes impulsions, vous pouvez contrôler FlatFlap pour des applications à actionnement rapide. Consultez le dépôt GitHub DriveCell pour plus d'exemples de code et de documentation technique !

  • Partager:

Partage

Github

  • À propos
  • Logiciel
  • Éducation
  • Contact
  • FAQ
  • Termes
  • Politique de remboursement
  • politique de confidentialité

Soyez le premier informé des nouveaux projets et bénéficiez d'offres intéressantes !

© 2026 Microbots.

★ Reviews

Let customers speak for us

50 reviews
Write a review
84%
(42)
4%
(2)
2%
(1)
4%
(2)
6%
(3)
21
46
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!).

A
CodeCell C6
Anonymous

I use CodeCell C6, like all the Features, and compactness. The remote Link to the iPhone with some Controls for 2 Motors is just perfect for the job.

O
CodeCell C6 Drive
Odd_Jayy

This is one of my Favorite finds, this board has everything you need to make a quick and small robot, easy to set up and install. Perfect for beginners or a person who needs to save room in their build.

User picture
123