
#include <QuadratureEncoder.h>
// must also have enableInterrupt.h library

// Use any 2 pins for interrupt, this utilizes EnableInterrupt Library. 
// Even analog pins can be used. A0 = 14,A1=15,..etc for arduino nano/uno

Encoders rightEncoder(8,9); // Encoder object name rightEncoder using analog pin A0 and A1 
float t = 0;
float theta=0;

void setup() {
  Serial.begin(9600);
}


unsigned long lastMilli = 0;

void loop() {

    
  while(t<10){
    long count = -rightEncoder.getEncoderCount();
    theta=count*0.7732;
    t = millis();
    t = t/1000.0;
    Serial.print(t);
    Serial.print(", ");
    Serial.print(count);
    Serial.print(", ");
    Serial.println(theta);    
    delay(10);
  }
  while(1){}
   
}
