Arduino mega2560 + MD25

Hello,
I’m a new Arduino user and I’m trying to comunicate an Arduino mega2560 with a MD25 (engine controller).
I’ve connected MD25 ground with GND of the Arduino board and also SDA with pin 20 and SCL with pin 21 (with their corresponding pull-up resistors).
I have attached the code used.
I tried it but it doesn’t work, nothing happens, no move, no green led…
Can anyone help me?
Maybe I am asking simple things, but I don’t know anything about this…

Thanks

Carme

sketch_feb12a.ino (8.56 KB)

pinMode ? The Wire library doesn't seem to call pinMode on SCL or SDA pins....

SCL and SDA ara input's or outputs?

I though it wasn't necessary because Ardunimega 2560 has specific pins for I2C.

Can you help with that configuration?

Thanks

By default everything is set as an INPUT. Some libraries call pinMode() for you, some don't.

I’ve added this two line to the code

pinMode(20, OUTPUT);
pinMode(21, OUTPUT);

But nothing happens…

Post the sketch you are trying to run.

Here it is.

Sorry, I though it was already attached.

sketch_feb12a.ino (8.56 KB)

Problem solved! There was a problem with GND connection.

Thanks