Converting values to g

Hello,
I need help converting values of an Accelerometer sensor. It has 12gb so the values are from 0 to 4096.
I need to convert a given "value" to g.
Having +-2g range I need to set 4096 to 2g and 0 to -2g to then plot the values.
Can you please help?
Thank you.

Respuestas (1)

Voss
Voss el 22 de Sept. de 2021
Editada: Voss el 22 de Sept. de 2021

0 votos

g_val = double(val)/4096*4*g-2*g;
plot(g_val);

Categorías

Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.

Productos

Versión

R2021a

Preguntada:

el 22 de Sept. de 2021

Editada:

el 22 de Sept. de 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by