beginSPI and beginI2C call begin twice
pbolduc opened this issue · 1 comments
pbolduc commented
In functions beginSPI and beginI2C there are two calls to the begin function. The begin function has a 2 ms delay at the start to accommodate BME280 startup. When using a BME280, this introduces more delay that is required. Capturing the return value of begin and using it in the comparisons will eliminate the extra startup delay. PR will be submitted shortly.
Change
if(begin() == 0x58) return(true); //Begin normal init with these settings. Should return chip ID of 0x58 for BMP
if(begin() == 0x60) return(true); //Begin normal init with these settings. Should return chip ID of 0x60 for BMEto
uint8_t chipID = begin();
if(chipID == 0x58) return(true); //Begin normal init with these settings. Should return chip ID of 0x58 for BMP
if(chipID == 0x60) return(true); //Begin normal init with these settings. Should return chip ID of 0x60 for BMEAndyEngland521 commented
added pull request and released in v2.0.6. Thanks for your work!