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.
Fork of 2ndOfilter by
Revision 0:f2a2b5a88616, committed 2018-07-22
- Comitter:
- NiNiHtayLwin
- Date:
- Sun Jul 22 09:41:09 2018 +0000
- Child:
- 1:57f0db59db9f
- Commit message:
- 2ndOFil
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/QEI.lib Sun Jul 22 09:41:09 2018 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/aberk/code/QEI/#5c2ad81551aa
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Jul 22 09:41:09 2018 +0000 @@ -0,0 +1,39 @@ +#include "QEI.h" +#include "mbed.h" +Serial pc(USBTX, USBRX); +double prv_time = 0.0; +double now_time = 0.0; +double samp_time = 0.0; +double now_x = 0.0; +double now_d = 0.0; +double prv_d = 0.0; +double pr2v_d = 0.0; +double a = 0.0; +double b = 0.0; +double c = 0.0; +double PI = 3.1416; +double fc = 0.05/(2*PI); +double C =(2*PI*fc)*(2*PI*fc) ; +double B = sqrt(2*C); +int main() +{ + Timer myTime; + myTime.reset(); + myTime.start(); + pc.baud(57600); + while(1) { + now_time = myTime.read_ms()/1000.0; + samp_time = now_time - prv_time; + now_x = sin(2*PI*0.5*now_time) + 0.5*sin(2*PI*100*now_time); + a = ((samp_time*samp_time)*C)*now_x; + b = (2+(samp_time*B))*prv_d; + c = pr2v_d; + now_d = (a+b-c)/(((samp_time*samp_time)*C)+(samp_time*B)+1); + + pc.printf(" %F %F %F %F\r", now_time, samp_time, now_x, now_d); + printf("\n\r"); + prv_time = now_time; + prv_d = now_d; + pr2v_d = prv_d; + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Jul 22 09:41:09 2018 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/a7c7b631e539 \ No newline at end of file