- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am not sure if this is the place to post this question so let me know if I need to post it somewhere else. I am interfacing an accelerometer with an 8k PSoC1 via i2c. I need to cacluate a specific angle from the accelerometer data without using the <math.h> library. I know the value of two sides and could use arctan to get that angle but when i include <math.h> I run out fo code space. Is this a possibility? If so how can I do this?
Thanks...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are some approximations using pure integer arithmetic. have a look here, you can extract the sources from the pdf
http://www.freescale.com/files/sensors/doc/app_note/AN4248.pdf
Happy coding
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Some other possibilties -
http://www.dsprelated.com/showmessage/21872/1.php
Cordic and Chebychev also popular.
http://www.mathworks.com/products/demos/fixedpt/arctangent/fixpt_atan2_demo.html
http://emesystems.com/BS2mathC.htm
http://www.numericana.com/answer/functions.htm#cheb
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content