Пытаюсь по аналогии заставить работать вторую крутилку.
Код получился такой:
PHP код:
#define encoder0PinA  2   
#define encoder0PinB  3  
#define encoder0PinC  4 
#define encoder1PinA  5   
#define encoder1PinB  6  
#define encoder1PinC  7 
byte bytes[2]={0,7} ;    

void setup()    
{      
  
pinMode(encoder0PinAINPUT);    
  
digitalWrite(encoder0PinAHIGH);     // подключить подтягивающий резистор   
  
pinMode(encoder0PinBINPUT);    
  
digitalWrite(encoder0PinBHIGH);    // подключить подтягивающий резистор  
  
pinMode(encoder0PinCINPUT);    
  
digitalWrite(encoder0PinCHIGH);    // подключить подтягивающий резистор   
  
pinMode(encoder1PinAINPUT);    
  
digitalWrite(encoder1PinAHIGH);     // подключить подтягивающий резистор   
  
pinMode(encoder1PinBINPUT);    
  
digitalWrite(encoder1PinBHIGH);    // подключить подтягивающий резистор  
  
pinMode(encoder1PinCINPUT);    
  
digitalWrite(encoder1PinCHIGH);    // подключить подтягивающий резистор   
   
  
attachInterrupt(0doEncoderAFALLING);  // настроить прерывание interrupt 0 на pin 2   
  
attachInterrupt(1doEncoderBFALLING);  // настроить прерывание interrupt 0 на pin 3   
  
attachInterrupt(0doEncoder1AFALLING);  // настроить прерывание interrupt 0 на pin 2   
  
attachInterrupt(1doEncoder1BFALLING);  // настроить прерывание interrupt 0 на pin 3   
  
Serial.begin (115200);   
}    

void loop()   
{     
 if(
digitalRead(encoder0PinC)==LOW)  
   { 
     
bytes[1]=8
      
Serial.writebytes,2);   
      while(
digitalRead(encoder0PinC)==LOW){delay(50);} 
       
bytes[1]=7;  
   } 
  if(
digitalRead(encoder1PinC)==LOW)  
   { 
     
bytes[1]=8
      
Serial.writebytes,2);   
      while(
digitalRead(encoder1PinC)==LOW){delay(50);} 
       
bytes[1]=7;  
   } 
}   

// обработка прерывания   
void doEncoderA()   
{   
  if(
digitalRead(encoder0PinB)==HIGH){bytes[0]=25;}else{bytes[0]=5;}    
  
Serial.writebytes,2);  
  
bytes[0]=0
}     

// обработка прерывания   
void doEncoderB()   
{   
    if(
digitalRead(encoder0PinA)==HIGH){bytes[0]=5;}else{bytes[0]=25;}   
    
Serial.writebytes,2);  
    
bytes[0]=0;     


// обработка прерывания   
void doEncoder1A()   
{   
  if(
digitalRead(encoder1PinB)==HIGH){bytes[0]=25;}else{bytes[0]=5;}    
  
Serial.writebytes,2);  
  
bytes[0]=0
}     

// обработка прерывания   
void doEncoder1B()   
{   
    if(
digitalRead(encoder1PinA)==HIGH){bytes[0]=5;}else{bytes[0]=25;}   
    
Serial.writebytes,2);  
    
bytes[0]=0;     

У второго энкодера заработала только кнопка, но эта кнопка дублирует кнопку первого энкодера.
5, 6 ноги - крутилка, 7 - кнопка.