Update HS_STATUS.md

This commit is contained in:
HomeSpan 2022-11-05 11:56:07 -04:00 committed by GitHub
parent 22a004e315
commit 2ff19dcc30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 0 deletions

View File

@ -59,6 +59,25 @@ const char* Span::statusString(HS_STATUS s){
}
```
Example
```C++
#include "HomeSpan.h"
void setup(){
homeSpan.setStatusCallback(statusUpdate); // set callback function
...
homeSpan.begin();
...
}
// create a callback function that simply prints the pre-defined short messages on the Serial Monitor whenever the HomeSpan status changes
void statusUpdate(HS_STATUS status){
Serial.printf("\n*** HOMESPAN STATUS CHANGE: %s\n",homeSpan.statusString(status));
}
```
You can of course create any alternative messsages, or take any actions desired, in *func* and do not need to use the pre-defined strings above.
---