Seeed-Studio / Seeed_Arduino_GroveAI

Arduino library for Grove Vision AI
MIT License
23 stars 10 forks source link

Compilation error with 'PIN_WIRE_SDA' was not declared in this scope #6

Closed ysyyork closed 1 year ago

ysyyork commented 1 year ago

Describe the bug I added the lib into arduino and I just try to compile this one line and I got compilation error below

#include "Seeed_Arduino_GroveAI.h"
In file included from /private/var/folders/14/bfxws12j2mxb1_94v17zfb8w0000gn/T/.arduinoIDE-unsaved2023723-4399-q13ydo.qelsq/sketch_aug23a/sketch_aug23a.ino:1:
/Users/aa/Documents/Arduino/libraries/Seeed_Arduino_GroveAI-1.1.0/Seeed_Arduino_GroveAI.h:229:53: error: 'PIN_WIRE_SDA' was not declared in this scope; did you mean 'PIN_WIRE0_SDA'?
  229 |     WEI(TwoWire &wire_com = Wire, uint32_t pinSDA = PIN_WIRE_SDA, uint32_t pinSCL = PIN_WIRE_SCL): _wire_com(&wire_com), _pinSDA(pinSDA), _pinSCL(pinSCL) {}
      |                                                     ^~~~~~~~~~~~
      |                                                     PIN_WIRE0_SDA
/Users/aa/Documents/Arduino/libraries/Seeed_Arduino_GroveAI-1.1.0/Seeed_Arduino_GroveAI.h:229:85: error: 'PIN_WIRE_SCL' was not declared in this scope; did you mean 'PIN_WIRE0_SCL'?
  229 |     WEI(TwoWire &wire_com = Wire, uint32_t pinSDA = PIN_WIRE_SDA, uint32_t pinSCL = PIN_WIRE_SCL): _wire_com(&wire_com), _pinSDA(pinSDA), _pinSCL(pinSCL) {}
      |                                                                                     ^~~~~~~~~~~~
      |                                                                                     PIN_WIRE0_SCL

exit status 1

To Reproduce

  1. Download this lib from release page with zip
  2. Include this zip lib into arduino
  3. create a new INO file and copy in the code #include "Seeed_Arduino_GroveAI.h"
  4. click upload for compiling.

Expected behavior it should compile without error

Additional context I checked the source code for this header, the complain makes sense. There is no PIN_WIRE_SCL or PIN_WIRE_SDA declaration in the code. idk where these variables come from.

I'm following this tutorial https://wiki.seeedstudio.com/Grove-Vision-AI-Module/ and I'm currently using a Seeed Xiao -RP2040 with this Vision AI module. but since it's compiling error, I don't feel it's related to my hardware at the moment.

ysyyork commented 1 year ago

nvm, i figured, this pin definition is provided by system. and for xiao series, it's PIN_WIRE0_SDA and PIN_WIRE0_SLA.