I have one question / problem:
The library works perfectly, but i want to remove delayMicroseconds(...); and instead use software timer.
When i'm using software counters or library e.g. chrono the SPI reading is messing up
i know that.
a) I tried to use the micros () function, it doesnt work properly...
b) The sensor data was incorrectly read or was not read at all
I would like the library to be able to be used for multitasking programs
So I would like to ask what the support for such SPI buses looks like
So I need advice on how this code should look without using the delayMicroseconds() function, as it is in professional libraries with proper support of the SPI bus.
Maybe I did something wrong, I am asking for advice / example.
I'm surprised that this code works for you, most people would expect the data to be read after one or at a deterministic number of calls of ReadData(). How do you know when a new value was read?
And yes, the function ReadData() needs to be call couple times, but if you using timers instead delay in main loop function there is no problem.
I was write example code with timer for you (interval is 100ms but just for display values on serial, the data is reading < 1ms):
As you can see the data cycle is about 86 + 107 + 84 + 702 = 979us.
The goal was to make about 1kHz dara reading rate for my steering wheel Logitech G29, and it was achieved