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
00001 /* 00002 */ 00003 00004 #include "Unwrapper.h" 00005 #define pi 3.141592653589793 00006 using namespace std; 00007 00008 Unwrapper::Unwrapper(double i2r) 00009 { 00010 inc2rad = i2r; 00011 last_value = 0; 00012 } 00013 00014 Unwrapper::~Unwrapper() {} 00015 00016 void Unwrapper::reset(void) 00017 { 00018 last_value = 0; 00019 } 00020 00021 double Unwrapper::doStep(short inc) 00022 { 00023 long temp = inc; 00024 if((temp - last_value) > 32000) 00025 temp -= 0xFFFF; 00026 else if((temp - last_value) < -32000) 00027 temp += 0xFFFF; 00028 last_value = temp; 00029 return (temp*inc2rad); 00030 }
Generated on Wed Jul 13 2022 23:05:32 by
1.7.2