Hi,
What is the difference between Wire.write and Wire.send?
I read Language Reference but I still do not understand... it is probably something about one byte or more byte.... ??
Could you explaint to me in example? Thank
Hi,
What is the difference between Wire.write and Wire.send?
I read Language Reference but I still do not understand... it is probably something about one byte or more byte.... ??
Could you explaint to me in example? Thank
As per Arduino Reference Manual, send() and write() methods are functionally equivalent (Fig-1); but. send() method is not supported by my Wire.h Library (there is compilation error).
send() no longer exists. It was replaced by write() around 10 years ago.
If you see code that uses Wire.send() it likely will not compile.
send() was a void function and write() could return a status code.
Unless you plan to use an IDE that is older than 10 years (pre 1.0) then you won't have to worry about using or supporting Wire.send()
The Arduino developers made a very poor / dumb decision around 10 years ago during the 1.0 release.
They were all the way to a final release candidate and then between the final release candidate and the final release, they made some major changes and consciously decided that they were not going to be backward compatible - even though with a few tiny additions about 90% of the existing APIs could be supported.
These changes along with deciding to not provide any backward compatibility transition period broke the entire Arduino world. 100% of ALL existing 3rd party libraries and the majority of all existing sketch code broke.
Even though it is now a bit over 10 years since this happened, there are still code examples, and documentation out there that still references the older now non existent API functions.
--- bill
OK, thank you!