diff --git a/examples/breakout_pmw3901/frame_capture/frame_capture.cpp b/examples/breakout_pmw3901/frame_capture/frame_capture.cpp index be6942f3..71f3a55c 100644 --- a/examples/breakout_pmw3901/frame_capture/frame_capture.cpp +++ b/examples/breakout_pmw3901/frame_capture/frame_capture.cpp @@ -2,17 +2,22 @@ #include "pico/stdlib.h" #include +// Uncomment the below line to switch from the PMW3901 to the PAA5100 +//#define USE_PAA5100 + +#ifndef USE_PAA5100 + #include "breakout_pmw3901.hpp" +#else + #include "breakout_paa5100.hpp" +#endif + using namespace pimoroni; -// Pick *one* sensor type by uncommenting the relevant lines below: - -// PMW3901 -#include "breakout_pmw3901.hpp" -typedef BreakoutPMW3901 FlowSensor; - -// PAA5100 -//include "breakout_paa5100.hpp" -//typedef BreakoutPAA5100 FlowSensor; +#ifndef USE_PAA5100 + typedef BreakoutPMW3901 FlowSensor; +#else + typedef BreakoutPAA5100 FlowSensor; +#endif diff --git a/examples/breakout_pmw3901/motion/motion.cpp b/examples/breakout_pmw3901/motion/motion.cpp index 39ca21fd..469e276a 100644 --- a/examples/breakout_pmw3901/motion/motion.cpp +++ b/examples/breakout_pmw3901/motion/motion.cpp @@ -1,17 +1,22 @@ #include #include "pico/stdlib.h" +// Uncomment the below line to switch from the PMW3901 to the PAA5100 +//#define USE_PAA5100 + +#ifndef USE_PAA5100 + #include "breakout_pmw3901.hpp" +#else + #include "breakout_paa5100.hpp" +#endif + using namespace pimoroni; -// Pick *one* sensor type by uncommenting the relevant lines below: - -// PMW3901 -#include "breakout_pmw3901.hpp" -typedef BreakoutPMW3901 FlowSensor; - -// PAA5100 -//include "breakout_paa5100.hpp" -//typedef BreakoutPAA5100 FlowSensor; +#ifndef USE_PAA5100 + typedef BreakoutPMW3901 FlowSensor; +#else + typedef BreakoutPAA5100 FlowSensor; +#endif FlowSensor flo(BG_SPI_FRONT);