riz_raxi
Junior Member level 1
- Joined
- Mar 29, 2014
- Messages
- 19
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 126
Dear Sir,
I want to interface 3 more DAC chips for my current code with 3 more pins of arduino which are interfaced with I2C. I have used wire.h currently. How can i do 3 more? I mean how to change wire.h and which specific thing is to change for 3 more PCF8591 chips of DAC chip to be interfaced with 3 pins of arduino through 3 soft I2C communications.
Summarizing it, I need to understand i2c communication through soft pins and their code.
Thank you
My current code for one pin i2c is
I want to interface 3 more DAC chips for my current code with 3 more pins of arduino which are interfaced with I2C. I have used wire.h currently. How can i do 3 more? I mean how to change wire.h and which specific thing is to change for 3 more PCF8591 chips of DAC chip to be interfaced with 3 pins of arduino through 3 soft I2C communications.
Summarizing it, I need to understand i2c communication through soft pins and their code.
Thank you
My current code for one pin i2c is
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 #include "Wire.h" #define PCF8591 0x90 >> 1 void setup() { Wire.begin(); Serial.begin(9600); } int val=0; void loop() { if (Serial.available()) { val = Serial.read(); } //for (int i=0; i<256; i++) //{ Wire.beginTransmission(PCF8591); // wake up PCF8591 Wire.write(0x40); // control byte - turn on DAC (binary 1000000) Wire.write(val); // value to send to DAC Wire.endTransmission(); // end tranmission //val=val+1; //} /*for (int i=255; i>=0; --i) { Wire.beginTransmission(PCF8591); // wake up PCF8591 Wire.write(0x40); // control byte - turn on DAC (binary 1000000) Wire.write(i); // value to send to DAC Wire.endTransmission(); // end tranmission }*/ }
Last edited by a moderator: