function plotVoltage

   fclose('all')
   a = arduino();
   
   volt_data = zeros(500,1);
   time_data = zeros(500,1);
   n_datapoints = 0;
   tic
   figure
   while(true)
       n_datapoints = n_datapoints + 1;
       if (n_datapoints<500)
         volt_data(n_datapoints) = readVoltage(a,'A0');
         time_data(n_datapoints) = toc;
       else
           volt_data(1:499) = volt_data(2:500);
           time_data(1:499) = time_data(2:500);
           volt_data(500) = readVoltage('A0');
           time_data(500) = toc;
       end
       pause(0.1);
       clf;
       plot(time_data(1:n_datapoints),volt_data(1:n_datapoints));
       
   end
       
       
       
   end
