Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Unwrapper.cpp
- Committer:
- altb
- Date:
- 2019-02-25
- Revision:
- 11:78e723ede0c6
- Parent:
- 0:d784b08f51ff
File content as of revision 11:78e723ede0c6:
/* */ #include "Unwrapper.h" #define pi 3.141592653589793 using namespace std; Unwrapper::Unwrapper(double i2r) { inc2rad = i2r; last_value = 0; } Unwrapper::~Unwrapper() {} void Unwrapper::reset(void) { last_value = 0; } double Unwrapper::doStep(short inc) { long temp = inc; if((temp - last_value) > 32000) temp -= 0xFFFF; else if((temp - last_value) < -32000) temp += 0xFFFF; last_value = temp; return (temp*inc2rad); }