Hi naifar mourad,
In theory it is possible to calculate speed of an object using an accelerometer sensor.
If the acceleration of an object is known, we can get a proportional approximation of the speed data if an integration is applied.
Unfortunately we do not have any updated document with information about how to do this with the MMA8451Q/KL46Z, however, we do have an application note that mentions how to calculate velocity/speed (and positioning) using the accelerometer MMA7260 (which is no longer manufactured), but you can use this document as a reference to create your own code.
Application note: AN3397 “Implementing Positioning Algorithms Using Accelerometers”
You can also use the bare metal example project of the MMA8451Q that can be found in Freescale communities: https://community.freescale.com/docs/DOC-98836
I hope this helps.
Have a great day,
Jose Reyes
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------