RP2040_Servomoteurs/Servomoteur.h

23 lines
526 B
C

#include "pico/stdlib.h"
// Valeur des servomoteurs
#define SERVO_VALEUR_MAX 10459
#define SERVO_VALEUR_2MS 1056
#define SERVO_VALEUR_1_5MS 784
#define SERVO_VALEUR_1MS 523
#define SERVO_VALEUR_0_5MS 261
// Nom des GPIOs des servomoteurs.
// Ici, SERVO0 utilisera la GPIO 0 du RP2040
#define SERVO0 0
#define SERVO1 1
// Position prédéfinies
#define DOIGT_AVANCE 0, SERVO_VALEUR_1_5MS
#define DOIGT_RETRAIT 0, SERVO_VALEUR_0_5MS
void Servomoteur_Init(void);
void Servomoteur_set(uint8_t servomoteur, uint16_t valeur);