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:
ladyada 2025-08-27 09:24:30 -04:00
parent 72dc808eb4
commit 1387918ce6
2 changed files with 2 additions and 2 deletions

View file

@ -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);

View file

@ -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); }