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.
Revision 3:0ac797e55e49, committed 2016-06-17
- Comitter:
- highroads
- Date:
- Fri Jun 17 17:31:48 2016 +0000
- Parent:
- 2:3de053b7541f
- Commit message:
- Print out current address
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Jun 17 17:13:35 2016 +0000
+++ b/main.cpp Fri Jun 17 17:31:48 2016 +0000
@@ -71,7 +71,7 @@
}
int main() {
-
+ uint8_t retaddr;
wait_ms(100); // delay .1s
sensor.getIdentification(&identification); // Retrieve manufacture info from device memory
@@ -91,7 +91,8 @@
wait_ms(1000); // delay 1s
//
printf("Change sensor address to 0x27\n");
- sensor.changeAddress(0x29,0x27);
+ retaddr=sensor.changeAddress(0x29,0x27);
+ printf("Sensor addres is now %x\n",retaddr);
sensor.getIdentification(&identification); // Retrieve manufacture info from device memory
printIdentification(&identification); // Helper function to print all the Module information
printf("Ambient Light Level (Lux) = ");
@@ -99,7 +100,8 @@
wait_ms(1000); // delay 1s
printf("Change sensor address back to 0x29\n");
- sensor.changeAddress(0x27,0x29);
+ retaddr=sensor.changeAddress(0x27,0x29);
+ printf("Sensor addres is now %x\n",retaddr);
sensor.getIdentification(&identification); // Retrieve manufacture info from device memory
printIdentification(&identification); // Helper function to print all the Module information
printf("Ambient Light Level (Lux) = ");