unfinished
Dependents: WRS_mechanamu_test WRS2019_master mbed_2018 mbed_2019_rx3 ... more
Diff: JY901.cpp
- Revision:
- 2:5af50b300137
- Parent:
- 1:6bcbd18a719a
- Child:
- 4:cd62e2d69f62
--- a/JY901.cpp Sun Feb 04 13:41:04 2018 +0000 +++ b/JY901.cpp Sat Apr 28 03:55:58 2018 +0000 @@ -197,53 +197,6 @@ return (float)((*(data+1) << 8) | *data) / 4095; } -int JY901::getmode(float (JY901::*getFunc)(), const int kaisu) -{ - /*exampl - printf("%d\r\n", obj.getmode(&JY901::getYawAngle, 10)); - */ - int yawangle[128] = {}; - int samecount[128] = {}; - int tmpcount[128] = {}; - int num = 0; - for(int i = 0; i < kaisu; i++) - { - yawangle[i] = (int)((this->*getFunc)() + 0.5); - } - for(int i = 0; i < kaisu; i++) - { - for(int j = 0; j < kaisu; j++) - { - if(yawangle[i] == yawangle[j]) - { - samecount[i]++; - } - } - tmpcount[i] = samecount[i]; - } - for(int i = 0; i < kaisu; i++) - { - for(int j = 0; j < i; j++) - { - if(tmpcount[i] > tmpcount[j]) - { - int tmp = tmpcount[j]; - tmpcount[j] = tmpcount[i]; - tmpcount[i] = tmp; - } - } - } - int mostcount = tmpcount[0]; - for(int i = 0; i < kaisu; i++) - { - if(samecount[i] == mostcount) - { - num = i; - } - } - return yawangle[num]; -} - float JY901::getPressure() //not use { char *dataL = getdata(PressureL);