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
Diff: main.cpp
- Revision:
- 17:08d6d9badb3f
- Parent:
- 16:6b4a71e6f75a
- Child:
- 18:d7a681bc22e5
--- a/main.cpp Wed Apr 05 01:35:55 2017 +0000
+++ b/main.cpp Wed Apr 05 01:49:16 2017 +0000
@@ -51,7 +51,7 @@
//movement
int deadzone = 1;
-int mouseMoveMult = 40;
+int mouseMoveMult = 20;
//counts for clicks
int clickDeadzone = 10;
@@ -149,8 +149,8 @@
//look at delta btwn prev val and current
//TODO: moving average
if((prevx != 1023 || prevy != 1023) && (currx != 1023 && curry != 1023)){
- int diffX = currx - prevx;
- int diffY = -1*(curry - prevy);
+ short diffX = currx - prevx;
+ short diffY = -1*(curry - prevy);
//fix diffX
if(diffX > deadzone){
@@ -163,7 +163,7 @@
//fix diffY
if(diffY > deadzone){
diffY -= deadzone;
- } else if (diffX < -1*deadzone){
+ } else if (diffY < -1*deadzone){
diffY += deadzone;
} else{
diffY = 0;
@@ -176,7 +176,7 @@
updatex[0] = diffX;
updatey[0] = diffY;
-
+
// pc.printf("updating x to : %d", diffX);
// pc.printf("\t updating y to : %d \n", diffY);

