LOCODUINO

Aide
Forum de discussion
Dépôt GIT Locoduino
Flux RSS

samedi 27 avril 2024

Visiteurs connectés : 71

La bibliothèque SlowMotionServo

. Par : Jean-Luc

Après la réalisation du logiciel de pilotage de servomoteurs destiné à la commande d’actionneurs d’aiguillages, voir « Manœuvre des aiguilles avec des servomoteurs » j’ai voulu m’attaquer à la manœuvre de portes de remises et de barrières de passage à niveau. Les mouvements à accomplir sont plus complexes mais aussi plus visuels. La technique (...)

Retourner à l'article

Vous répondez à :

La bibliothèque SlowMotionServo 13 septembre 2023 18:42, par Pépito

Pour info, afin de pouvoir disposer de la fonction delay() ou d’avoir un programme conséquent qui va impacter la fonction SlowMotionServo::update()
Il est possible de placer cette fonction dans une boucle while qui va permettre un rafraichissement très rapide de l’état du servo.
ici le booléen Départ permet de rentrer la première fois dans la boucle puis c’est la fin du mouvement du servo qui permet d’en sortir :

bool Depart = 1;
while(Depart == 1 || monServo.isStopped() == 0){
  Depart = 0;
  if (monServo.isStopped()) {
    positionCible = 1 - positionCible;
    monServo.goTo(positionCible);
  }
  SlowMotionServo::update(); /* actualisation de la position */ 
}
delay(5000);
Qui êtes-vous ?
Votre message

Pour créer des paragraphes, laissez simplement des lignes vides.

Lien hypertexte

(Si votre message se réfère à un article publié sur le Web, ou à une page fournissant plus d’informations, vous pouvez indiquer ci-après le titre de la page et son adresse.)

63 Messages

Rubrique Bibliothèques

Bibliothèque Accessories (1)

Bibliothèque Accessories (2)

Un décodeur d’accessoires universel (1)

Un décodeur d’accessoires universel (2)

Un décodeur d’accessoires universel (3)

Bibliothèque LcdUi (1)

Bibliothèque LcdUi (2)

Bibliothèque LightEffect

La bibliothèque ACAN (2)

La bibliothèque ACAN (1)

Bibliothèque DcDccNanoController

Bibliothèque DCCpp

Bibliothèque Commanders

La bibliothèque SlowMotionServo

Bibliothèque EEPROMextent

Bibliothèque MemoryUsage

La bibliothèque ScheduleTable

Bibliothèque LCD

Bibliothèque Wire : I2C

Bibliothèque EEPROM

Bibliothèque Serial

Bibliothèque SoftWare Serial

La bibliothèque Servo

Les derniers articles

Bibliothèque LightEffect


Christian

La bibliothèque ACAN (2)


Jean-Luc

La bibliothèque ACAN (1)


Jean-Luc

La bibliothèque SlowMotionServo


Jean-Luc

Bibliothèque DCCpp


Thierry

Bibliothèque DcDccNanoController


Thierry

Bibliothèque LcdUi (2)


Thierry

Bibliothèque LcdUi (1)


Thierry

Bibliothèque Accessories (2)


Thierry

Bibliothèque Accessories (1)


Thierry

Les articles les plus lus

Bibliothèque Wire : I2C

Un décodeur d’accessoires universel (1)

Bibliothèque DCCpp

Bibliothèque DcDccNanoController

Bibliothèque Commanders

La bibliothèque Servo

La bibliothèque ACAN (1)

Bibliothèque SoftWare Serial

Bibliothèque LCD

Bibliothèque Serial