12/27/2023 0 Comments Wire library i2c arduinoI am specifically intrigued by the different responses from the two platforms (MSP and ESP) for the same sketch. However, for ESP8266(Arduino), before using I2C, pins for SDA and SCL need to be set by calling Wire.begin(int sda, int scl), if different from defaults. ![]() For Energia, no argument is required for Wire.begin() as a master. I have confirmed both SCLs (MSP430 and ESP) are at a nominal 100 KHz. Only change in the code for the two platforms is the pin allocation (See comments in code).Īddress detection works fine as per code in setup(). ![]() This function writes one byte over IIC Wire.beginTransmission(MP元115A2_ADDRESS) Serial.println("No response - check connections") Serial.print("I2C device found at address 0x") /for(address = 1 address < 127 address++ ) #define MP元115A2_ADDRESS 0圆0 // 7-bit I2C address Code uses only wire.h (i.e., no device specific libraries included). Sample code to get I2C working (on MP元115A2 Pressure sensor) has been tested on the ESP12 using Arduino environment. pins_energia.h has been suitably modified and board integrated into Energia (Version 18 at this time). I am creating sample applications for a MSP430F5538 board in Energia environment.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |