Skip to content

Commit

Permalink
Merge pull request #24 from pintert3/master
Browse files Browse the repository at this point in the history
add NO_SW_SERIAL_REQUIRED define for software serial compatibility
  • Loading branch information
avaldebe authored May 16, 2022
2 parents f6f2280 + 19ec102 commit 5126ea9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,17 @@ set_temp_offset(-0.6);
set_rhum_offset(2);
```

## SoftwareSerial Compatibility

Some libraries (e.g [Arduino-SDI-12](https://github.com/EnviroDIY/Arduino-SDI-12)) conflict with SoftwareSerial library, which is loaded by default for
some boards. In order to disable SoftwareSerial compatibility, define `NO_SW_SERIAL_REQUIRED` before
including the library. For example:

```c++
#define NO_SW_SERIAL_REQUIRED
#include <PMSerial.h>
```

## Contribute

If you have read this far, this is the library for your project
Expand Down
2 changes: 1 addition & 1 deletion src/PMserial.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <HardwareSerial.h>
#endif

#if defined(__AVR__) || defined(ESP8266)
#if (defined(__AVR__) || defined(ESP8266)) && !defined(NO_SW_SERIAL_REQUIRED)
#define HAS_SW_SERIAL
#include <SoftwareSerial.h>
#endif
Expand Down

0 comments on commit 5126ea9

Please sign in to comment.