 
 float conversion_factor = 1.0;
 
-volatile int pulse_count[2];
-volatile int ring_buffer[2][BUF_LEN];
+volatile int pulse_count[2] = {
+  0};
+volatile int ring_buffer[2][BUF_LEN] = {
+  0};
 
 void setup()
 {
-  memset(pulse_count, 0, sizeof(pulse_count));
-  memset(ring_buffer, 0, sizeof(ring_buffer));
-
   Serial.begin(115200);
 
   pinMode(IRQ_0_PIN, INPUT_PULLUP);

  ring_buffer[IRQ_0][idx] = pulse_count[IRQ_0];
  ring_buffer[IRQ_1][idx] = pulse_count[IRQ_1];

  memset(pulse_count, 0, sizeof(pulse_count));
}

void tach_0_isr()

{
  pulse_count[IRQ_1]++;
}

