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.
Dependencies: mbed
Revision 23:db56e04d555b, committed 2017-04-13
- Comitter:
- daviwang
- Date:
- Thu Apr 13 21:41:19 2017 +0000
- Parent:
- 22:99ff69f7111a
- Child:
- 24:d4b944e1e6cd
- Commit message:
- added write cap to filter out finger lift/place jitter
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Apr 13 18:58:04 2017 +0000 +++ b/main.cpp Thu Apr 13 21:41:19 2017 +0000 @@ -53,7 +53,7 @@ //movement const int deadzone = 1; const int mouseMoveMult = 3; -const double mouseMovePwr = 1.3; +const double mouseMovePwr = 1.4; //click state const int CLICK_DEAD_ZONE = 20; @@ -164,7 +164,9 @@ short diffY = -1*(curry - prevy); //fix diffX - if(diffX > deadzone){ + if(abs(diffX) > 10) { + diffX = 0; + } else if(diffX > deadzone){ diffX -= deadzone; } else if (diffX < -1*deadzone){ diffX += deadzone; @@ -172,7 +174,9 @@ diffX = 0; } //fix diffY - if(diffY > deadzone){ + if(abs(diffY) > 10) { + diffY = 0; + } else if(diffY > deadzone){ diffY -= deadzone; } else if (diffY < -1*deadzone){ diffY += deadzone;