Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of LAB11_Oppgave01 by
Revision 2:3d70a9ba2a58, committed 2015-12-08
- Comitter:
- knut_johan
- Date:
- Tue Dec 08 15:43:46 2015 +0000
- Parent:
- 1:2d9d32fc4f5d
- Commit message:
- LAB11_
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 2d9d32fc4f5d -r 3d70a9ba2a58 main.cpp
--- a/main.cpp Tue Nov 10 13:25:36 2015 +0000
+++ b/main.cpp Tue Dec 08 15:43:46 2015 +0000
@@ -3,10 +3,13 @@
I2C i2cBus(I2C_SDA, I2C_SCL);
int main()
-{
+{ int i2cAddres;
i2cBus.frequency(100000);
- int i2cAddres=0x68; // Address of DS1307 is 0x68 (7 bit address)
+ i2cAddres=0x68;
+ for(i2cAddres=3;i2cAddres<119;i2cAddres++) // I2C device found at address 0x52
+ {
+ // Address of DS1307 is 0x68 (7 bit address)
int i2c8BitAddres= i2cAddres <<1; // Convert to 8bit addressing used by mbed
int result=i2cBus.write(i2c8BitAddres, NULL, 0);
@@ -15,6 +18,7 @@
if (result==0)
printf("I2C device found at address 0x%02X \r\n", i2cAddres);
else
- printf("I2C device Not found at address 0x%02X \r\n", i2cAddres);
+ printf("I2C device Not found at address 0x%02X \r\n", i2cAddres);
+ }
}
