<commit_before>int encoderSignalA = 0;
int encoderSignalB = 1;

float pulses = 0.5;

void setup()
{
  Serial.begin(115200);
  attachInterrupt(11, encoderRiseA, RISING);
  attachInterrupt(12, encoderRiseB, RISING);
}

void loop()
{
  // DO NOTHING, ONLY USE INTERRUPTS!
}

void encoderRiseA()
{
  // Detach the interrupt, set another later
  detachInterrupt(11);
  encoderSignalA = 1;

  // Moving forward
  if (encoderSignalB == 0)
  {
    pulses = pulses + 0.5;
  }
  // Moving reverse
  if (encoderSignalB == 1)
  {
    pulses = pulses - 0.5;
  }
  
  Serial.println(pulses);
  // Remember to attach interrupt with a new ISR
  attachInterrupt(11, encoderFallA, FALLING);
}

void encoderFallA() {
  detachInterrupt(11);
  encoderSignalA = 0;

  if (encoderSignalB == 1)
  {
    pulses = pulses + 0.5;
  }
  if (encoderSignalB == 0)
  {
    pulses = pulses - 0.5;
  }
  
  Serial.println(pulses);
  attachInterrupt(11, encoderRiseA, RISING);
}

void encoderRiseB() {
  detachInterrupt(12);
  encoderSignalB = 1;

  if (encoderSignalA == 1)
  {
    pulses = pulses + 0.5;
  }  
  if (encoderSignalA == 0)
  {
    pulses = pulses - 0.5;
  }
  
  Serial.println(pulses);
  attachInterrupt(12, encoderFallB, FALLING);
}

void encoderFallB()
{
  detachInterrupt(12);
  encoderSignalB = 0;

  if (encoderSignalA == 0)
  {
    pulses = pulses + 0.5;
  }  
  if (encoderSignalA == 1)
  {
    pulses = pulses - 0.5;
  }
  
  Serial.println(pulses);
  attachInterrupt(12, encoderRiseB, RISING);
}<commit_msg>Some tweaks were done to the ISR's<commit_after>int encoderSignalA = 0;
int encoderSignalB = 1;

float pulses = 0.5;

void setup()
{
  Serial.begin(115200);
  attachInterrupt(11, encoderRiseA, RISING);
  attachInterrupt(12, encoderRiseB, RISING);
}

void loop()
{
  // DO NOTHING, ONLY USE INTERRUPTS!
}

void encoderRiseA()
{
  // Detach the interrupt, set another later
  detachInterrupt(11);
  encoderSignalA = 1;

  // Moving forward
  if (encoderSignalB == 0)
  {
    pulses = pulses + 0.5;
  }
  // Moving reverse
  if (encoderSignalB == 1)
  {
    pulses = pulses - 0.5;
  }

  Serial.println(pulses);
  // Remember to attach interrupt with a new ISR
  attachInterrupt(11, encoderFallA, FALLING);
}

void encoderFallA() {
  detachInterrupt(11);
  encoderSignalA = 0;

  if (encoderSignalB == 1)
  {
    pulses = pulses + 0.5;
  }
  if (encoderSignalB == 0)
  {
    pulses = pulses - 0.5;
  }

  Serial.println(pulses);
  attachInterrupt(11, encoderRiseA, RISING);
}

void encoderRiseB() {
  detachInterrupt(12);
  encoderSignalB = 1;

  if (encoderSignalA == 1)
  {
    pulses = pulses + 0.5;
  }
  if (encoderSignalA == 0)
  {
    pulses = pulses - 0.5;
  }

  Serial.println(pulses);
  attachInterrupt(12, encoderFallB, FALLING);
}

void encoderFallB()
{
  detachInterrupt(12);
  encoderSignalB = 0;

  if (encoderSignalA == 0)
  {
    pulses = pulses + 0.5;
  }
  if (encoderSignalA == 1)
  {
    pulses = pulses - 0.5;
  }

  Serial.println(pulses);
  attachInterrupt(12, encoderRiseB, RISING);
}
{'fraction_non_alphanumeric': 0.1314475873544093, 'fraction_numerical': 0.03860232945091514, 'mean_word_length': 3.0566801619433197, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2643321', 'n_tokens_mistral': 1297, 'n_tokens_neox': 1150, 'n_words': 260}