We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
感谢分享,在AliveDetector.h的ActiveDetector_Shake类中getState()方法有一些不理解。
AliveDetector.h
ActiveDetector_Shake
getState()
bool getState() { if (idx < CYCLE_ACTIVE) return false; int sum = 0; bool flag = 0; for (int i = 0; i < CYCLE_ACTIVE; i++) { if (frames[i] > 11 || frames[i] < -11) { flag = 1; } if (frames[i] > 8) sum++; else if (frames[i] < -8) sum--; } if (abs(sum - 0) < 6 && flag == 1) return true; else return false; }
为什么frames[i]<-8时,sum需要--;
为什么最后if判断时需要判断“abs(sum-0)<6”;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
感谢分享,在
AliveDetector.h
的ActiveDetector_Shake
类中getState()
方法有一些不理解。为什么frames[i]<-8时,sum需要--;
为什么最后if判断时需要判断“abs(sum-0)<6”;
The text was updated successfully, but these errors were encountered: