Arduino Rotary Encoder Pulses? I made an program so if I turn on my rotary encoder the position and the rotation comes on a LCD screen. But I need to change it a bit up for my teacher, she wants to see the graph of the pulses on the serial monitor. I searched it up and can't find a solution? Any help?

My program: 

#include &lt;LiquidCrystal_I2C.h&gt; 
LiquidCrystal_I2C lcd(0x27,16,2); 
#define outputA 2 
#define outputB 4 
int counter = 0; 
int angle = 0; 
int aState; 
int aLastState; 
int lastAngle = 0; 
String rotationDirection; 
String savedRotationDirection;

void setup() {
  pinMode (outputA,INPUT);
  pinMode (outputB,INPUT);

  aLastState = digitalRead(outputA);
  lcd.begin();


     } 

void loop() {
  aState = digitalRead(outputA);
  if (aState != aLastState){     
     if (digitalRead(outputB) != aState) { 
       counter ++;
       angle ++;
     }
     else {
       counter--;
       angle --;
     }
     if (counter &gt;=30 ) {
      counter = 0;
     } 

     if (angle &lt; lastAngle){
      rotationDirection = "CCW";
     }
     else {
      if (angle &gt; lastAngle){
        rotationDirection = "CW";
      }
      else {
        rotationDirection = savedRotationDirection;
      }
     }
     lcd.clear();
     lcd.setCursor(0,0);
     lcd.print("Position: ");
     lcd.print(int(angle)*(-1));
     lcd.print((char)223); 
     lcd.setCursor(0,1);
     lcd.print("Rotation: ");
     lcd.print(rotationDirection);
     savedRotationDirection = rotationDirection;
     lastAngle = angle;
  }
  aLastState = aState;

}
Add Serial.begin(115200); in setup() and use Serial.println() or Serial.print() to print to Serial.

In Arduino IDE open Serial Monitor and set baud rate to 115200.

EDIT: The question turned out to be about Serial Plotter. Maximilian Gerhardt answered in a comment :


  If you want multiple data streams (graphs) you need to seperate them
  by a comma: Serial.println( String(digitalRead(outputA)) + "," +
  String(digitalRead(outputB)));