Skip to content

Use two I2c Bus #7

Feb 24, 2024 · 6 comments · 8 replies
Discussion options

You must be logged in to vote

I have added now some update (=set) API. If you want to update just a field:

// get current pin value 
auto i2c_opt = AudioKitEs8388V1.getPins().getI2CPins(PinFunction::CODEC);
if (i2c_opt){
  auto i2c = i2c_opt.value();
  i2c.p_wire = &Wire1;
  // update infrmation
  AudioKitEs8388V1.getPins().setI2C(i2c);
}

Or if you want to provide all values

PinsI2C i2c{PinFunction::CODEC, 32, 33, -1, 100000U, Wire1};
AudioKitEs8388V1.getPins().setI2C(i2c);

I suggest to check the return code of the add and set functions: they return true if successful

Replies: 6 comments 8 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@uutzinger
Comment options

@FatherMarco1971
Comment options

@pschatzmann
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@FatherMarco1971
Comment options

Comment options

You must be logged in to vote
3 replies
@FatherMarco1971
Comment options

@pschatzmann
Comment options

@FatherMarco1971
Comment options

Comment options

You must be logged in to vote
1 reply
@FatherMarco1971
Comment options

Answer selected by FatherMarco1971
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants