Convert from an input pulse frequency to output another in near real time?

Or a little faster:

unsigned long ConvertToHalfCycleTime(unsigned long inputCycleTime)
{
  // To "reduce the frequency by a factor of 0.865" we
  // divide the cycle time by  0.865.
  unsigned long halfOutputCycleTime = inputCycleTime * 1000 / 865 / 2;
  return halfOutputCycleTime;
}
1 Like