Here's a patch to display data from two D6T sensors on the same I2C bus. The clock line is switched using a 4051 analog multiplexer. The control line is GPIO_17 of the Pi connected to A of the 4051 (B, C and Inhibit are at 0V). 10k resistors to 3.3V are on each sensor's clock line at X0 and X1 of the 4051 (I2C clock connects to X). Because the code accesses the GPIO file system it needs to be run as root. I have two different sensors so the code reads two different packet lengths. Just a proof of concept, there could be up to 8 identical sensors on the same bus with this setup.
Martin
On 2013-04-25 20:04, Julian Brooks wrote:
Just spotted this:
https://github.com/kadamski/i2c-gpio-param
Could be useful
On 25 April 2013 15:54, Martin Peach <martin.peach@sympatico.ca<mailto:martin.peach@sympatico.ca>> wrote:
On 2013-04-25 10:37, Julian Brooks wrote:
'Nother 2 dumb questions:
What's the difference between the ones that have
spider/centipede type
legs and the straight ones (which would be best to get).
The PDIP package is what you want, not the SOIC. The only difference
is size. DIP packages are human-friendly, surface mount is for robots.
And also are you attaching the MC14051 to any type of
board/adaptor or
just soldering straight on to the pins?
I have it in a breadboard right now, to make it more permanent I
would solder a socket to a prototyping board then (after verifying
the connections) plug the chip into the socket. Soldering to the
pins makes it difficult to replace the IC, and risks damaging it
with the heat if you're not good at soldering quickly and to the
point. A CD4051 would also work, it's basically the same circuit.
Martin