sandeepmistry / arduino-LoRa

An Arduino library for sending and receiving data using LoRa radios.
MIT License
1.61k stars 621 forks source link

Is there a difference between using LoRa.print() and LoRa.write() ? #555

Closed levycarneiro closed 2 years ago

levycarneiro commented 2 years ago

Is there a difference between using LoRa.print() and LoRa.write() ?

Thanks.

Kongduino commented 2 years ago

print(), as the name suggests, is for Strings or char arrays. A 0x00 will stop transmission. write() has 2 version:

  virtual size_t write(uint8_t byte);
  virtual size_t write(const uint8_t *buffer, size_t size);

It either writes one byte, or a buffer of size bytes, regardless of the content.

levycarneiro commented 2 years ago

Clear now. Thanks very much, @Kongduino !