Post topics, source code that relate to the Arduino Platform

User avatar
By Ghassan Yusuf
#47688 Dear Friends

I bought a node mcu dev kit v3 (please see the attachments). the one that looks like an arduino and could be programed via micro USB cable. now i was planning to build an application the allowes me to read from MPU9250 9DOF Sensor. But the problem is that dev kit dosent have any I2C pins, i have tried to look for sample codes that might work but sadly i am unlucky i never got it to work. so would any one please tell me where to find a suitable library for

    1. MPU9250 That is compatible with Node MCU Devkit V3 In Arduino Platform
    2. Software I2C Library That Is Compatible With Node MCU Devkit V3 In Arduino Plat Form

Please If Any Of You Have An Idea
You do not have the required permissions to view the files attached to this post.
User avatar
By martinayotte
#47692 The Wire library that comes with Arduino ESP framework is already an Software I2C, simply need to provide on which pins you wish to use it.

https://github.com/esp8266/Arduino/tree ... aries/Wire

or if you have it already installed :

.arduino15/packages/esp8266/hardware/esp8266/2.2.0/libraries/Wire
User avatar
By Barnabybear
#47696 Hi, +1 on that and it works a treat.
You need to:
#include <Wire.h>
Set GPIO's to be used:

Code: Select allWire.begin(2,0); //start Wire and set SDA - SCL  // Note 1

Then send some data:

Code: Select allWire.beginTransmission(0x41);  //Note 2
Wire.write(00);  // Note 3
Wire.write(0xa1);   // Note 4
Wire.endTransmission();   // Note 5


Note 1: GPIO's 0 & 2 are good, as like I2C lines they have to be pulled high (10K works for short distances - 4.7K is better).
Note 2: Adds the address of the device to be communicated with to the output buffer.
Note 3: Adds some data to the output buffer.
Note 4 : Adds some more data to the output buffer.
Note 5: Writes the contents of the buffer.

You will be reading but it should be just as easy.