Closed edspark closed 3 months ago
Haven't reviewed, but in testing the Ultrasonic Arduino lib, I get the following warning:
c:\Users\Dryw\Documents\Arduino\libraries\SparkFun_Toolkit\src\sfeTkArdI2C.cpp: In member function 'virtual sfeTkError_t sfeTkArdI2C::writeBlock(const uint8_t*, size_t)':
c:\Users\Dryw\Documents\Arduino\libraries\SparkFun_Toolkit\src\sfeTkArdI2C.cpp:129:9: error: unused variable 'nData' [-Werror=unused-variable]
129 | int nData = 0;
| ^~~~~
cc1plus.exe: some warnings being treated as errors
I strongly recommend setting "Compiler warnings" in Arduino to "All" so these warnings show up
I've been using the arduino-cli and didn't even think to increase verbosity! I will do that!
I added a few more methods for reading from a device without a register parameter. This compliments the previously added write methods. I have enabled warnings to makes sure I didn't miss those, and I've also adjusted the language around the description of the new and existing methods in the pull request. Many apologies for the disjointed manner of this pull request.
Can I get another look at this? There's a library that is dependent on these functions going live this week. Thanks!
Issues addressed, may I get another look @gigapod? Thank you!
This adds two new functions that target the same functionality as
writeByte()
:writeWord()
andwriteBlock()
. The intent is to be able to send data over I2C without indexing to a register. This is helpful in the case where the device simply expects I2C commands over I2C. Examples of this include products like the new Ultrasonic Distance Sensor, Quad Relay, Qwiic Twist, Qwiic RFID, etc. Basically devices, at least in the examples I listed, that have micro-controllers that act as peripherals.