I am currently looking into an issue where the HX711 can go into sleep mode, resulting in bad data being received by the boron. See thread below:
@Joel suggested using the actually SPI and SPI.transfer to attempt to communicate to the HX711 via the hardware SPI. I have done some research but am at a bit of a loss as to where to start.
Will I need to make use of the:
SPI.setDataMode(SPI_MODE2);
command and is SPI_MODE2 the mode that I should use. Also in the actual SPI.transfer command:
Am I correct in saying that tx and rx are byte arrays. Do I just fill the outgoing array with dummy data and read the incoming array after calling the .transfer function?
From what I have gathered the myFunction callback can be used to ensure that the comms process has been completed, for this to work do I just return a bool from myFunction and wait for that value?
The docs also explain that.
When you provide NULL as callback function the call will be synchronous - this means the function will not return unless length bytes have been received.
If you want the call to be asynchronous the callback will be called when all data has been received and therein you can deal with the just received data however you wish (including just setting a flag which may then "instruct" loop() to deal with the data).
Perfect I’ll give this a go. Thanks for the pointers @ScruffR, and not just in this thread. I’ll post again with either a solution, further findings or the next time I get stuck.