kopia lustrzana https://github.com/jgromes/RadioLib
Updated Debug mode (markdown)
rodzic
9b573e5ace
commit
c4e2df6df2
|
@ -9,19 +9,6 @@ To enable debug, you can go to the [BuildOpt.h](https://github.com/jgromes/Radio
|
|||
//#define RADIOLIB_VERBOSE
|
||||
```
|
||||
|
||||
Alternatively, you can define the debug macros in the Arduino sketch - much like [custom build configuration](https://github.com/jgromes/RadioLib/wiki/Custom-Build-Configuration), this must be done prior to including the main library header file:
|
||||
|
||||
```c++
|
||||
#define RADIOLIB_DEBUG
|
||||
#define RADIOLIB_VERBOSE
|
||||
|
||||
#include <RadioLib.h>
|
||||
|
||||
void setup() {
|
||||
// etc.
|
||||
}
|
||||
```
|
||||
|
||||
The default debug port is set to `Serial`, on most Arduino boards, this should correspond to the Serial port connected to USB. If you want to use a different port, simply change the value of `RADIOLIB_DEBUG_PORT` macro to e.g. `Serial2`, or whichever Serial port you want to use. `SoftwareSerial` ports are supported as well.
|
||||
|
||||
__NOTE:__ RadioLib DOES NOT automatically initialize the debug port with `Serial.begin()`. This is done to prevent collisions when user already calls the `begin()` method from Arduino sketch. For that reason, debug interface initialization MUST be done prior to RadioLib module initialization (e.g. `lora.begin()`, otherwise there will be no debug output from the `begin()` method.
|
||||
|
|
Ładowanie…
Reference in New Issue