Update example with new packet size and discussion link

This commit is contained in:
Crsarmv7l 2025-02-12 12:30:09 +01:00 committed by GitHub
parent 97264c5c4a
commit 311862bba6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,7 +2,7 @@
RadioLib CC1101 Blocking Transmit Example RadioLib CC1101 Blocking Transmit Example
This example transmits packets using CC1101 FSK radio module. This example transmits packets using CC1101 FSK radio module.
Each packet contains up to 64 bytes of data, in the form of: Each packet contains up to 255 bytes of data with some limitations (https://github.com/jgromes/RadioLib/discussions/1138), in the form of:
- Arduino String - Arduino String
- null-terminated char array (C-string) - null-terminated char array (C-string)
- arbitrary binary data (byte array) - arbitrary binary data (byte array)
@ -57,11 +57,11 @@ int count = 0;
void loop() { void loop() {
Serial.print(F("[CC1101] Transmitting packet ... ")); Serial.print(F("[CC1101] Transmitting packet ... "));
// you can transmit C-string or Arduino string up to 64 characters long // you can transmit C-string or Arduino string up to 255 characters long
String str = "Hello World! #" + String(count++); String str = "Hello World! #" + String(count++);
int state = radio.transmit(str); int state = radio.transmit(str);
// you can also transmit byte array up to 64 bytes long // you can also transmit byte array up to 255 bytes long with some limitations; https://github.com/jgromes/RadioLib/discussions/1138
/* /*
byte byteArr[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF}; byte byteArr[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF};
int state = radio.transmit(byteArr, 8); int state = radio.transmit(byteArr, 8);
@ -72,7 +72,7 @@ void loop() {
Serial.println(F("success!")); Serial.println(F("success!"));
} else if (state == RADIOLIB_ERR_PACKET_TOO_LONG) { } else if (state == RADIOLIB_ERR_PACKET_TOO_LONG) {
// the supplied packet was longer than 64 bytes // the supplied packet was longer than 255 bytes
Serial.println(F("too long!")); Serial.println(F("too long!"));
} else { } else {