24 tooth input to simulate 36 output
simulate this circuit &ndash; Schematic created using CircuitLab

Frequency doubling is easy enough by triggering on every change of state of the input signal (a) for a fixed time resulting in waveform (b). It should be fairly trivial coding to pass this through to the output but mute every fourth pulse to give you three out for every two in.









simulate this circuit

Figure 2. A three-phase clock (a), (b) and (c) gives 72 pulses/rev (d) which can be divided by two to give 36 pulses/rev.

Another option to get accurate timing is to use three sensors offset by an integer  number of teeth + 5° and + 10° (1/3 tooth and 2/3 tooth). This will give you 72 pulse per revolution and you can divide by two to get 36 (e).



I'd recommend that you don't use built-in delay functions. Your code can't do anything else in the meantime. Create timers and check on each scan to see if they have elapsed.