Arduino advance retard ignition 1 cylinder bike

ive been working on arduino ignition system for my bike . in simple terms i have incoming signal pulse coming from engine which is responsible to trigger ignition coil. when the engine is running at lower rpm then there should be a max delay of 5mS between signal pulse and igniton coil triggering. for example if engine send a signal pulse then the ignition coil trigger after 5ms. and this delay should be decrease accordingly to the engine RPM increases ( at 13000 RPM delay must be 0). im beginner to arduino and this advance retard technology is too old but nobody has solid answer on the internet not even the arduino forum. all they do is making conversation complicating and then no result. if anyone can help me with the code that would be greatly appericiated

22 posts were merged into an existing topic: Sensing the signal and put delay based on RPM and then OUTPUT