Jump to content

Recommended Posts

I am trying to use the I2C communication using SDA(1)-SCL(1) and also by using SDA(2)-SCL(2) with library wire.h, but it is not working. wire1 or wire2 are also not available, how to use the I2C with SDA(2)-SCL(2) using  energia.

Following is the program tried for the for SDA(0)-SCL(0)  but it is also not working.


#include <Wire.h>
void setup() {
  Wire.begin();        // join i2c bus (address optional for master)
  Serial.begin(9600);  // start serial for output
void loop() {
  Wire.requestFrom(8, 6);    // request 6 bytes from slave device #8
  while (Wire.available()) { // slave may send less than requested
    char c = Wire.read(); // receive a byte as character
    Serial.print©;         // print the character
Thanks in advance.
Link to post
Share on other sites

You can use Wire.setModule(x) by using 0 to 3 to select the port. By default it is on PN4/PN5. The current implementation does not support multiple instances of the Wire library.

Also make sure that you have pullups on the SDA/SCL line.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...