Jesús Torres
/
ADNS9500
Interface to access to Avago ADNS-9500 laser mouse sensors.
Revision 4:dddfb08cebc2, committed 2012-03-22
- Comitter:
- aplatanado
- Date:
- Thu Mar 22 19:09:49 2012 +0000
- Parent:
- 3:898ed1944119
- Child:
- 5:08f209c15e53
- Commit message:
- attach to motion interrupt before sensor reset.
Changed in this revision
examples/main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/examples/main.cpp Thu Mar 22 17:36:49 2012 +0000 +++ b/examples/main.cpp Thu Mar 22 19:09:49 2012 +0000 @@ -3,8 +3,8 @@ #include "adns9500.hpp" -//#define USE_MOTION_BURST -#define FRAME_CAPTURE +#define USE_MOTION_BURST +//#define FRAME_CAPTURE const char* FIRMWARE_FILENAME = "/local/adns9500.fw"; LocalFileSystem local("local"); @@ -36,8 +36,11 @@ #if defined (USE_MOTION_BURST) adns9500::MotionData data; + sensor.attach(&motionCallback); #elif defined (FRAME_CAPTURE) uint8_t frame[adns9500::NUMBER_OF_PIXELS_PER_FRAME]; +#else + sensor.attach(&motionCallback); #endif sensor.reset(); @@ -54,7 +57,6 @@ #if ! defined (FRAME_CAPTURE) printData.attach_us(&printDataCallback, 500); - sensor.attach(&motionCallback); #endif while(true) {