I have tried to add the Wire library to the srv.pde to establish an I2C,
The slave code:
#include <Wire.h>
void setup()
{
Wire.begin(100);
Wire.onReceive(receiveEvent);
}
void loop()
{
}
void receiveEvent( int howMany)
{
while (Wire.available())
{
}
}
The master code, is the srv.pde and I added:
#include <Wire.h>
#include <AccelStepper.h>
and to the void loop(), I added
Wire.beginTransmission (100);
Do I need to end the transmission (I mean add Wire.endTransmission() to the code)? Or the transmission should automatically end when I disconnect the arduino?
Adding #include <AccelStepper.h> to the code didn't seem to have an effect, the 2 motors still don't run simultaneously. What do I have to do to fix this?