From aaeefee74c6c73ae11a9cc4d57ef079b421cb40a Mon Sep 17 00:00:00 2001 From: pgp Date: Tue, 15 Dec 2020 11:22:43 +0100 Subject: [PATCH] changements adressage pins --- src/main.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 74e82d6..1c4f9c1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -16,18 +16,17 @@ #define PCNT_L_LIM_VAL 0 //valeur mini du compteur //#define PCNT_THRESH1_VAL 5 //#define PCNT_THRESH0_VAL -5 -#define PCNT_INPUT_SIG_IO 4 // Pulse Input GPIO -#define PCNT_INPUT_CTRL_IO 5 // Control GPIO HIGH=count up, LOW=count down +#define PCNT_INPUT_SIG_IO 15 // Pulse Input GPIO +#define PCNT_INPUT_CTRL_IO 2 // Control GPIO HIGH=count up, LOW=count down //PID -#define PIN_INPUT 0 //entrée physique perso? +#define PIN_INPUT 26 //entrée physique perso? #define PIN_OUTPUT 3// sortie physique perso? -//PID Define Variables we'll be connecting to -double Setpoint, Input, Output; -//PID Specify the links and initial tuning parameters -double Kp=2, Ki=5, Kd=1; +double Setpoint, Input, Output; //PID Define Variables we'll be connecting to +double Kp=2, Ki=5, Kd=1; //PID Specify the links and initial tuning parameters PID myPID(&Input, &Output, &Setpoint, Kp, Ki, Kd, DIRECT); + int numero_capteur = 0; // numéro de série du capteur int bouton_wifi = 7; // pin du bouton wifi bool sem_wifi; //semaphore du minuteur du bouton wifi @@ -94,7 +93,7 @@ void start_compteur() { //pcnt_counter_pause(PCNT_TEST_UNIT); /*Reset counter value*/ pcnt_counter_clear(PCNT_TEST_UNIT); - /*Register ISR handler*/ + /*Register ISR handler - à activer par défaut? */ //pcnt_isr_register(pcnt_example_intr_handler, NULL, 0, NULL); /*Enable interrupt for PCNT unit*/ //pcnt_intr_enable(PCNT_TEST_UNIT); @@ -212,9 +211,10 @@ void vigie () { void setup() { // serial just for feedback Serial.begin(115200); - // wifi + // bouton wifi pinMode(bouton_wifi, INPUT); sem_wifi = false; // initialisation du sémaphore + pinMode() // moteur moteur.attach(pinMoteur); start_moteur();