Got to test the crank signal and spark signal all together with the oscilloscope. Great success! The signals are correct all the way up to 3600rpm! Over 3600rpm the signals gets shorter for some reason… Maybe its a miscalculation or the code could be to slow at that speed. I will look into this of course.
Here you can see the signals ( my oscilloscope just have 1 channel, that’s why the signals seems to be weak and they are all on one line.