Open lukeskymuh opened 5 years ago
It might take too long. The request handler should respond as fast as possible. Any code that stops interrupts or interrupt routines that take a long time influences the reaction time for the request handler. Using the Serial functions in a interrupt routine should also be avoided. Can you move the usage of SoftwareWire and Serial into the Arduino loop() ?
I had removed all Serial communication and between the reciveData(master sends command) and SendData(master requests data) is a 0.5 s delay. No sucess.
Did you also move the myWire.requestFrom() to the Arduino loop() ? It might be the same bug as: https://github.com/Testato/SoftwareWire/issues/19#issuecomment-472632760
I tried to use the Softwarewire library with the normal wire library in the same scetch to comunicate with a master(Mindstorms EV3) and a slave(I2C sensor). Each function for itself works but when I call "myWire.requestFrom(MPU_ADDR, 14, true);" the normal wire returns bougus results to the Mindstorms when it requests "sendData" is called. If I uncomment this line the numbers 1 to 8 apear as you would expect. Any adivice?