Control library for the Sparkfun Entertainment Trackballer breakout board.

Files at this revision

API Documentation at this revision

Comitter:
Nakor
Date:
Sat Feb 19 20:41:29 2011 +0000
Parent:
6:c0ebd0f8f873
Child:
8:2602108edf40
Commit message:

Changed in this revision

trackballer.cpp Show annotated file Show diff for this revision Revisions of this file
trackballer.h Show annotated file Show diff for this revision Revisions of this file
--- a/trackballer.cpp	Sat Feb 19 20:31:43 2011 +0000
+++ b/trackballer.cpp	Sat Feb 19 20:41:29 2011 +0000
@@ -36,8 +36,8 @@
     _lastLeftState = 0;
     _lastRightState = 0;
     
-    _xPosition = 0.0;
-    _yPosition = 0.0;
+    _xPosition = 0.5;
+    _yPosition = 0.5;
     
     
     _buttonPin->mode(PullUp);
@@ -203,4 +203,10 @@
     }
     #endif
 
+}
+
+void trackballer::reset()
+{
+    _xPosition = 0.5;
+    _yPosition = 0.5;
 }
\ No newline at end of file
--- a/trackballer.h	Sat Feb 19 20:31:43 2011 +0000
+++ b/trackballer.h	Sat Feb 19 20:41:29 2011 +0000
@@ -31,6 +31,7 @@
     trackballer(PinName button, PinName right, PinName down, PinName left, PinName up, PinName red, PinName green, PinName blue, PinName white, char limits = 0x00);
     
     void getState(float &xPosition, float &yPosition, char &button);
+    void reset();