Fix SPI begin() method ambiguity
Make SPIClass parameter non-optional to resolve compilation error when calling begin() with CS pin
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
72dc808eb4
commit
1387918ce6
2 changed files with 2 additions and 2 deletions
|
|
@ -179,7 +179,7 @@ class Adafruit_SPA06_003 {
|
|||
bool begin(uint8_t i2c_addr = SPA06_003_DEFAULT_ADDR, TwoWire *wire = &Wire);
|
||||
|
||||
// Hardware SPI initialization
|
||||
bool begin(int8_t cspin, SPIClass *theSPI = &SPI);
|
||||
bool begin(int8_t cspin, SPIClass *theSPI);
|
||||
|
||||
// Software SPI initialization
|
||||
bool begin(int8_t cspin, int8_t mosipin, int8_t misopin, int8_t sckpin);
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ void setup() {
|
|||
|
||||
// Try to initialize the sensor using hardware SPI
|
||||
// CS pin = 10, default SPI instance
|
||||
if (!spa.begin(SPA_CS_PIN)) {
|
||||
if (!spa.begin(SPA_CS_PIN, &SPI)) {
|
||||
Serial.println("Failed to find SPA06_003 chip via hardware SPI");
|
||||
Serial.println("Check wiring and try software SPI example");
|
||||
while (1) { delay(10); }
|
||||
|
|
|
|||
Loading…
Reference in a new issue