Enabling control of Audio Shield using different I²C busses

h4yn0nnym0u5e

Well-known member
Hi folks

I've put in PR #439 for an update I've done to enable use of any available TwoWire-based I²C bus for control of a PJRC audio shield, using AudioControlSGTL5000. You'll obviously have to make the relevant hardware changes yourself, but in theory this should let you stack 5 audio shields onto a Teensy 4.1 (four on I2S1 and the last one on I2S2), using Wire, Wire1 and Wire2 for control (2 shields set to the high address of 0x2A), and get a monster 10-output 4-input beast.

The evident change is adding a setWire() function, so using sgtl5000_3.setWire(Wire1,HIGH) will expect an SGTL5000 at address 0x2A on the Wire1 bus. You can also use sgtl5000_3.setWire(1,HIGH) for the same effect: busses 0 to 3 map to Wire, Wire1, Wire2 and Wire3. If it's needed, you must use setWire() before enable(). If not, just leave it out - all your old code should work exactly as before.

Do please report any issues you find, though I'm hopeful the changes are simple enough that I haven't dropped any major goolies.
 
Back
Top