[nRF24] Added packet counter
This commit is contained in:
parent
4981ce9934
commit
be97ba8543
1 changed files with 5 additions and 2 deletions
|
@ -95,6 +95,9 @@ void setFlag(void) {
|
|||
transmittedFlag = true;
|
||||
}
|
||||
|
||||
// counter to keep track of transmitted packets
|
||||
int count = 0;
|
||||
|
||||
void loop() {
|
||||
// check if the previous transmission finished
|
||||
if(transmittedFlag) {
|
||||
|
@ -127,8 +130,8 @@ void loop() {
|
|||
Serial.print(F("[nRF24] Sending another packet ... "));
|
||||
|
||||
// you can transmit C-string or Arduino string up to
|
||||
// 256 characters long
|
||||
transmissionState = radio.startTransmit("Hello World!");
|
||||
// 32 characters long
|
||||
transmissionState = radio.startTransmit("Hello World! #" + String(count++));
|
||||
|
||||
// you can also transmit byte array up to 256 bytes long
|
||||
/*
|
||||
|
|
Loading…
Add table
Reference in a new issue