Closed suhlig closed 3 years ago
According Travis, the build fails on ESP8266. Should the extra method be guarded by #ifdef
to limit this to ESP32?
Ah, I overlooked that part. Yes, an #ifdef
looks like a sensible way to solve that.
Just pushed a fixup commit.
Travis status seems out of sync - the builds are green now.
Hi @bertmelis any chance to merge this? Please note that the Travis checks are actually green; it seems just the reporting back to GH is broken somehow.
Sorry for the delay. Totally forgot about it.
The ESP32 has three serial ports. This allows to connect the SDS011 to a port that is different from the default one, so that we can still print to the default serial port and see what's going on with the SDS011.
So far this was not possible because
SDS011::setup
callsSerial.begin
with default args, which also means default pins.This PR adds an overloaded
SDS011::setup
which accepts arbitraryrx
andtx
pins as additional parameters.An alternative implementation would simply remove the
Serial.begin
call fromSDS011::setup
. I would actually prefer this, as it leaves setup to the caller. On the other hand, it would break existing clients, so I went with the approach in this PR.I also added an example that showcases the new behaviour.