Hi All -
Thanks for taking your time to read and suggest solution.
I'm planning to connect 11nos of ATTiny 85 through i2C multiplexer(previously had problem of noise pick-up and CLK level shifting above 0.8V - found hard to get clean data), ATTiny85 is used to read the frequency from TCS3200.
Enclosing the code for one sensor(later will extend it 11); I've connected all these ATTiny85 to UNO as maser, do not how to fetch the data from ATT85 to UNO.
Please guide me on this.
#include"Wire.h"
#define TCAADDR 0x70
void tcaselect(uint8_t i) {
if (i > 7) return;
Wire.beginTransmission(TCAADDR);
Wire.write(1 << i);
Wire.endTransmission(TCAADDR);
}
void setup() {
// put your setup code here, to run once:
Wire.begin();
}
void loop() {
uint8_t t;
// put your main code here, to run repeatedly:
for (t = 0; t < 1; t++) {
tcaselect(t);
}
Wire.requestFrom(0X70, 6); // request 6 bytes from slave device #8
while (Wire.available()) { // slave may send less than requested
int c = Wire.read(); // receive a byte as character
Serial.println(c); // print the character
Best,
Ramesha
ATTinyi2CMult.ino (665 Bytes)