Using I2C and digitalWrite for actuation

userHead RWBM 2019-01-26 21:19:13 1667 Views0 Replies
Hey everybody,

I'm currently working on a project where I have to use digital outputs, analog inputs as well as send data to an I2C bus. All sensors and actuators are working fine when standing alone. The routine is as follows:

1. Sending data to the I2C bus and thus steering actuators. Stop.
2. Setting digital outputs to steer other actuators. Stop.
3. Sending data to the I2C bus and steering the same actuators as in step 1. Stop.

In step 3, the message is not transmitted from the SDA&SCL pins. We tried:
  • leaving out step 2. Steps 1 and 3 work as they should.
  • leaving out step 1. Steps 2 and 3 work as they should.
  • step-by-step debugging the wireRequest-method. All variables are correctly calculated. Just the _serialPort.write(message, 0, index-1) method does not do as it should. COM5 (Arduino Leonardo) remained connected during the whole process.
  • destroying the old and rebuilding a new LattePanda instance between steps 2 and 3. No effect on step 3.

If anybody could point us to the solution, this would be greatly appreciated. This issue could become a neckbreaker for our project.