Are you running your code in the Arduino IDE, when you say you want to run the code without the library you mentioned do you still plan to use the Arduino IDE? When you say it does not work for me does that mean that the motor is completely unresponsive or do you get an error message if so, what errors do you get?
You also say you are running several motors, remember that the Romeo only has 1 I2C interface. Make sure you are powering using the correct power supply. Look at for details Romeo for Edison Controller SKU: DFR0350 - Robot Wiki
Yes I still want to run my 2 motors in Arduino IDE for now (without library). My next plan is go to mraa but first I want to resolve this problem.
My 2 motors are working OK(in Arduino IDE) when I run them with library. If I want to run them direct via i2c bus all motors are completely unresponsive. There is no error message.
Power is correct
I think I am sending wrong bytes or I am sending bytes in wrong sequence. I took this this example of code from library. I have no documentation what should I send to Atmega8.(this processor is managing motordriver L298P).
I need documentation or example of correct code to send commands via i2c bus. Do You know how can I gat those informations ??
The DFRobot page mentioned a bug with I2C communication and had an updated firmware
"Download the Atmega8 firmware V1.2 (The newest firmware V1.1+ fixed IIC communication bug)"
Did you have this firmware version? See Atmega8 Firmware Upgrade
There's some more debug options that you can pursue I suppose - You can upload a modified Atmega firmware (NG.ino) with DBG define set to 1 so that on receipt of I2C bytes, it will put it out on the Serial UART connected to Pin2 and Pin3 of J36 header. Probably you will have to use the ISP to flash the Atmega.
Hi, I will try to update my Atmega firmware with DBG = 1 to see more logs and I will back with any news
In spite of all I am thinking that I have already correct Atmega firmware because I can run my motors with DFRobot library. This library is using i2c communication. Can You confirm this speculations ?
I just checked around the code in the Motor.ino and the WiringAnalog.cpp files in the repository
And the wheelEnSlv function uses the following format in the WiringAnalog.cpp library
void DFrobotEdison::wheelEnSlv(uint32_t cmd)
So after the command, there is a zero byte that's being sent and not an FF - Can you check more on this side of the code?
Hi, I was trying with zero but it not help. One more odd issue I found in internet some example of code for scaning i2c. This program shows me 0 i2c devices So first I will try to update my Atmega firmware.
byte error, address;
nDevices = 0;
for(address = 0; address <= 127; address++ )
// The i2c_scanner uses the return value of
// the Write.endTransmisstion to see if
// a device did acknowledge to the address.
error = Wire.endTransmission();
if (error == 0)
Serial.print("I2C device found at address 0x");
else if (error==4)
Serial.print("Unknow error at address 0x");
if (nDevices == 0)
Serial.println("No I2C devices found\n");
delay(8000); // wait 8 seconds for next scan
I think problem was with last byte sending via i2c to atmega. This is byte with check sum. Below I put example of correct code to run DC motor (in mraa):
var m = require('mraa'); //require mraa
x = new m.I2c(1) // bus address
x.address(0x04) // atmega i2c address
buf = new Buffer(5)
buf = 0x55
buf = 0xaa
buf = 0xc1
buf = 0xff
buf = 0xBF // check sum = 0x55+0xaa+0xc1+0xff