drjohnsmith
Well-known member
I have a procedure, that uses the I2C on the teensey 3.6
I use all four of the available I2C's on the board,
At the moment, I have three procedures,
one for each of the I2C, which are remarkably similar,
one talks to wire, one to wire1, etc..
This is Ok,
but it strikes me that I should be able to code once and re use,
i.e. pass to the procedure the fact I want wire, or wire1 or ... etc
but, can't think how to do,
currently only 'solution' which is worse than the problem,
is to pass in a number 0 to 3 , that on each time I use the I2C lib in the procedure is used to select one of four cases,
very messy,
Any suggestions please
I use all four of the available I2C's on the board,
At the moment, I have three procedures,
one for each of the I2C, which are remarkably similar,
one talks to wire, one to wire1, etc..
This is Ok,
but it strikes me that I should be able to code once and re use,
i.e. pass to the procedure the fact I want wire, or wire1 or ... etc
but, can't think how to do,
currently only 'solution' which is worse than the problem,
is to pass in a number 0 to 3 , that on each time I use the I2C lib in the procedure is used to select one of four cases,
very messy,
Any suggestions please