Author |
Message |
Topic: Multiple I2C channels |
runemadsen
Replies: 12
Views: 37708
|
Forum: General CCS C Discussion Posted: Fri Aug 03, 2012 8:46 am Subject: Multiple I2C channels |
OK, I have fixed it.
In case others are interested here is what I did:
#use i2c(master,sda=PIN_C4, scl=PIN_C3,FORCE_SW,STREAM=ST1)
#use i2c(master,sda=PIN_C1, scl=PIN_C2,FORCE_SW,STRE ... |
Topic: Multiple I2C channels |
runemadsen
Replies: 12
Views: 37708
|
Forum: General CCS C Discussion Posted: Fri Aug 03, 2012 8:05 am Subject: Multiple I2C channels |
Yes, but the stream must be a constant, not a variable.
Then I have to copy up the code for each stream, in my case at least five.
Is it a way to avoid that?
Rune |
Topic: Multiple I2C channels |
runemadsen
Replies: 12
Views: 37708
|
Forum: General CCS C Discussion Posted: Fri Aug 03, 2012 7:48 am Subject: Multiple I2C channels |
I shall use some sensors with hardcoded and equal i2c addresses.
I therefore try to make up more i2c channels like this:
void select_sensor(int n){
if(n==1){
... |
|