Hello Achref,
Thank you very much for writing.
Once you configure your accelerometer and set up the transient detection, I recommend using a timer from your master device in order to turn off the corresponding LED after 10 seconds.
In this case, I made a very simple project using the PIT (Periodic Interrupt Timer) from the KL25Z as a reference for your application. Please find it attached to this response.
I used CodeWarrior v10.6 and the FRDM-KL25Z.
Please let me know if you have any further questions.
Regards,
David