From d08e790e9da0d0be246aee8c7c542a2a3ea03780 Mon Sep 17 00:00:00 2001 From: ZodiusInfuser Date: Mon, 13 Sep 2021 22:15:06 +0100 Subject: [PATCH] Fixed namespace error with pmw examples. --- .../frame_capture/frame_capture.cpp | 23 +++++++++++-------- examples/breakout_pmw3901/motion/motion.cpp | 23 +++++++++++-------- 2 files changed, 28 insertions(+), 18 deletions(-) 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);