![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
2
Dependencies: mbed DevInterfaces MCP4728 MCP4728setaddr I2Cinterfaces
Diff: main.cpp
- Revision:
- 5:18d7ce800a18
- Parent:
- 4:527490fdcfd8
- Child:
- 6:d1e569f370ac
--- a/main.cpp Fri Jan 13 12:45:37 2017 +0000 +++ b/main.cpp Fri Jan 13 14:00:15 2017 +0000 @@ -57,7 +57,7 @@ int newaddrint; // Set addr part MPC4728_address_set mpc4728(PTB0,&LDAC,i2cdev, &CntPin); - int i2cresult =mpc4728.readaddress(&oldaddr, &eeaddr, ®addr); + int i2cresult =mpc4728.readaddress(oldaddr, eeaddr, regaddr); if ( i2cresult ) { printf("failed to read current address error code: %d , scl cnt = %d \n", i2cresult,mpc4728.getsclcnt() ); } @@ -71,7 +71,7 @@ if ( i2cresult ) printf("failed to set address to %d error : %d , sclcnt= %d \n",newaddr, i2cresult,mpc4728.getsclcnt()); else { printf("set new address \n"); - i2cresult =mpc4728.readaddress(&oldaddr, &eeaddr, ®addr); + i2cresult =mpc4728.readaddress(oldaddr, eeaddr, regaddr); if ( i2cresult ) printf("failed to read (new) address error : %d \n", i2cresult); else printf( "new address = %d ,eeaddr %d , regaddr %d sclcnt= %d \n\r", (int) oldaddr,(int) eeaddr, (int)regaddr, mpc4728.getsclcnt()); printf( " new address = %d \n", (int) oldaddr); }