Conflit entre librairies

Salut a tous,

J'éssaye de fabriquer une radiocommande pour un multicopter, en fait un arduino (nano rev3) genere un signal ppm qui est envoyé dans un module genre sa Radio Control Planes, Drones, Cars, FPV, Quadcopters and more - Hobbyking

J'ai trouvé une librairie qui fait le boulot http://forum.arduino.cc/index.php/topic,20536.0.html#11, jusque la sa marchai plutot bien, puis j'ai voulu ajouter un ecran tft, et la bah sa marche plus

La librairie qui genere du ppm

// RCencoder.cpp
//

#include "RCEncoder.h"

/* variables for Encoder */
volatile  byte Channel = 0;  // the channel being pulsed
static byte OutputPin;       // the digital pin to use
/* processing states */
enum pulseStates {stateDISABLED, stateHIGH, stateLOW}; 
static byte pulseState = stateDISABLED;  

typedef struct {
  unsigned int ticks;  // we use 16 bit timer here so just store value to be compared as int
} Channel_t;

Channel_t Channels[NBR_OF_CHANNELS + 1];  // last entry is for sync pulse delay
 
ISR(TIMER1_COMPA_vect) {

   if( pulseState == stateLOW ) {
        digitalWrite(OutputPin, LOW);     
        OCR1A = Channels[Channel].ticks;
        pulseState = stateHIGH; 
   }
   
   else if(pulseState == stateHIGH)
   {
         OCR1A = MS_TO_TICKS(INTER_CHAN_DELAY);
             if( Channel < NBR_OF_CHANNELS)
            digitalWrite(OutputPin, HIGH);
         pulseState = stateLOW;
         if(++Channel > NBR_OF_CHANNELS) {// note that NBR_OF_CHANNELS+1 is the sync pulse
           Channel = 0;                 
         }       
   }    
}

// private functions
// -----------------------------------------------------------------------------
// convert microseconds to timer cycles + ticks, and store in the Channels array
static void ChannelStorePulseWidth(byte Channel, int microseconds) {
  cli();  
  Channels[Channel].ticks = MS_TO_TICKS(microseconds) ; 
  digitalWrite(ledTest1,HIGH);
  sei();             // enable interrupts 
#ifdef DEBUG  
   Serial.print(Channel,DEC);
   Serial.print("=\t");
   Serial.print(Channels[Channel].ticks,DEC);
   Serial.print("\r\n");
#endif
}

// user api
// -----------------------------------------------------------------------------
// turns on a Channels pulse of the specified length, on the specified pin
void encoderWrite(byte channel, int microseconds) {

    if ( microseconds > MAX_CHANNEL_PULSE ) {
         microseconds = MAX_CHANNEL_PULSE;
    } 
    else if ( microseconds < MIN_CHANNEL_PULSE ) {
         microseconds = MIN_CHANNEL_PULSE;
    }
    ChannelStorePulseWidth(channel, microseconds);
}

// start the encoder with output on the given pin
void encoderBegin(byte pin) {
  byte i; 
  OutputPin = pin;
  pinMode(OutputPin,OUTPUT);
   
  // initialize pulse width data in Channel array. 
  for (i=0; i < NBR_OF_CHANNELS; ++i) 
     ChannelStorePulseWidth(i, 1500);
     
  ChannelStorePulseWidth(NBR_OF_CHANNELS, SYNC_PULSE_WIDTH);  // store sync pulse width


 TIMSK1 |= (1<<OCIE1A); //Enable compare interrupt
  TCCR1A = _BV(WGM10) | _BV(WGM11);   //Timer 1 is Phase-correct 10-bit PWM. 
  TCCR1A |= _BV(COM1A1);              //Clear OC1A on compare match when up-counting, set OC1A on compare match when down-counting. 

   TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS11); /* div 8 clock prescaler */

  Channel = 0;
  pulseState = stateLOW; // flag ISR we are ready to pulse the channels
}
// RCEncoder.H

#ifndef RCEncoder_h
#define RCEncoder_h

#include "Arduino.h" 

#ifdef __cplusplus
extern "C"{
#endif


#define ledTest1 8
#define ledTest2 9

#define NBR_OF_CHANNELS  8
#define MIN_CHANNEL_PULSE 800  // 1ms 
#define MID_CHANNEL_PULSE 1300  // 1.5ms
#define MAX_CHANNEL_PULSE 1800  // 2 ms
#define INTER_CHAN_DELAY  200   // 200 microseconds 
#define FRAME_RATE        20000 // 20 ms 
#define SYNC_PULSE_WIDTH (FRAME_RATE - (NBR_OF_CHANNELS * (MID_CHANNEL_PULSE + INTER_CHAN_DELAY))) 
#define MS_TO_TICKS(_ms)  ((_ms) * 2)  // todo, use macro here

void encoderBegin(byte pin);
void encoderWrite(byte channel, int microseconds);

#ifdef __cplusplus
} // extern "C"
#endif

#endif

j'arrive pas a trouver la librairie qui gère le tft, c'est inclus dans l'ide mais je sais pas ou c'est caché

Quand j'allume le arduino le tft freeze et le signal ppm est inexistant
Je pense que c'est un probleme lié au timer, j'ai éssayé de modifier RCencoder.cpp pour qu'il utilise un autre timer, le 2, j'ai mi sa

TIMSK2 |= (1<<OCIE2A); //Enable compare interrupt
  TCCR2A = _BV(WGM20) | _BV(WGM21);   //Timer 1 is Phase-correct 10-bit PWM. 
  TCCR2A |= _BV(COM2A1);              //Clear OC1A on compare match when up-counting, set OC1A on compare match when down-counting. 

   TCCR2B = _BV(WGM22) | _BV(WGM22) | _BV(CS21); /* div 8 clock prescaler */

a la dernière ligne je ne peu pas mettre _BV(WGM23) sinon sa ne compile pas car wgm23 n'est pas déclaré...

et je change aussi TIMER1_COMPA_vect par TIMER2_COMPA_vect ainsi que OCR1A en OCR2B au debut de la librairie
La l'ecran tft fonctionne, mais le PPM fonctionne toujours pas, c'est surement pas aussi simple que de changer des 1 en 2 >:(
Si vous avez des idées sur comment changer le timer sa me branche bien, dans le sujet ou j'ai trouvé la librairie il l'on fait mais j'ai du louper un truc

Merci