constructing array of pulse values from arduino output