Intel® Makers
Intel® Edison, Intel® Joule™, Intel® Curie™, Intel® Galileo
Announcements
Welcome - This is a Peer-to-Peer Forum only. Intel has discontinued these products but you may find support from other customers on this Forum
9873 Discussions

Who can help me to translate Arduino I2C code to mraa I2C code.

HLiu37
Beginner
1,631 Views

I am confusing about my arduino I2C code, because I want to change it to mraa I2C code. I am not familiar with mraa I2C function. I just want to connect and communicate with my atmega8 chip. Because I want to read the analog sensor value. The following is the arduino code.

Wire.begin();

Wire.beginTransmission(4);

Wire.write(0x55);

Wire.write(0xaa);

Wire.write(cmd);

Wire.write(value);

Wire.write((unsigned char)(0x55+0xaa+cmd+value));

Wire.endTransmission();

I don't know what the appropriate mraa code is. I hope someone who can help me. I will really appreciate him.

1 Solution
Carlos_M_Intel
Employee
164 Views

Hi ToneLiu,

Take a look at the http://iotdk.intel.com/docs/master/mraa/ mraa: Main Page, you will see in there all the functions and features of the library. You could see thehttp://iotdk.intel.com/docs/master/mraa/i2c_8h.html i2c.h File Reference and http://iotdk.intel.com/docs/master/mraa/classmraa_1_1_i2c.html I2c Class Reference

In this website: https://github.com/intel-iot-devkit/mraa/tree/master/examples mraa/examples at master · intel-iot-devkit/mraa · GitHub you will see some examples with MRAA, I think it will be very helpful for you.

In order to translate the functions you want to use, it will depend on the language you are going to use, as you may know with the MRAA library you can use Javascript, Java, Python, C or C++.

Regards,

Charlie

View solution in original post

3 Replies
Carlos_M_Intel
Employee
165 Views

Hi ToneLiu,

Take a look at the http://iotdk.intel.com/docs/master/mraa/ mraa: Main Page, you will see in there all the functions and features of the library. You could see thehttp://iotdk.intel.com/docs/master/mraa/i2c_8h.html i2c.h File Reference and http://iotdk.intel.com/docs/master/mraa/classmraa_1_1_i2c.html I2c Class Reference

In this website: https://github.com/intel-iot-devkit/mraa/tree/master/examples mraa/examples at master · intel-iot-devkit/mraa · GitHub you will see some examples with MRAA, I think it will be very helpful for you.

In order to translate the functions you want to use, it will depend on the language you are going to use, as you may know with the MRAA library you can use Javascript, Java, Python, C or C++.

Regards,

Charlie

WDobr
Novice
164 Views

Hi,

I am working with Romeo for Intel® Edison Controller (With Intel® Edison). On this board there is integral motor driver L298P.

I am running motors with library https://github.com/ouki-wang/remeo4edison ouki-wang/remeo4edison - C++ - GitHub with success.

I was trying to run it in same way as in this library but it does not work. Can someone suggest me what is wrong with my code ?

I want to run motor1 with max speed 255

# include

 

void setup() {

 

Wire.begin();

 

Wire.beginTransmission(4);

 

Wire.write(0x55);

 

Wire.write(0xaa);

 

Wire.write(0xc1);

 

Wire.write(0xff);

 

Wire.write((unsigned char)(0x55+0xaa+0xc1+0xff));

 

Wire.endTransmission();

 

}

void loop() {

 

}
Carlos_M_Intel
Employee
164 Views

Hi wdobrzyc,

Have you tried with the example on: http://www.dfrobot.com/wiki/index.php/RoMeo_BLE_(SKU:DFR0305)# Speed_regulation_of_the_two-armature_DC_motor RoMeo BLE (SKU:DFR0305) - Robot Wiki

In the switch module you will see the function advance (255,255) that should allow you to use the max speed.

Regards,

Charlie

Reply