Skip to content

Pin 26 and Pin 27 Hardwired to SDA and SCL #14

@agalgano08

Description

@agalgano08

I need Pin 26,27 for a two wire motor running off a motor controller and I need it also for I2C to communicate with the touchscreen as it is hard wired in. Each works separately perfectly, but when I try and end the Wire and move the motor, nothing happens and no error is thrown.

Motor is custom class that uses ledc and works when the motor code is above the Wire setup code.

Is there a way to disable the I2C with the screen shortly disabling the screen touch feature and use the motor without interferance?

  Motor m1 = Motor(26, 27, 1);

  Wire.begin(26, 27);
  Serial.println("Wire Begin");

  int XL = 0;
  int XH = 0;
  int YL = 0;
  int YH = 0;

  int data = 0;
  Wire.beginTransmission(TOUCH_I2C_ADD);
  Wire.write(TOUCH_REG_XH);
  Wire.endTransmission();
  Wire.requestFrom(TOUCH_I2C_ADD, 1);

  if (Wire.available())
  {
    data = Wire.read();
  }
  XH = data;
  Wire.end();
  Serial.println("Wire End");

  m1.Move(100, HIGH);
  delay(1000);
  m1.Move(0, HIGH);
  delay(1000);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions