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 2:85afa5129e56, committed 2020-12-04
- Comitter:
- MACRUM
- Date:
- Fri Dec 04 11:02:11 2020 +0900
- Parent:
- 1:2651ad0f52c0
- Child:
- 3:0ca27c666888
- Commit message:
- Update library
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed-os.lib | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Apr 23 09:31:48 2018 +0000
+++ b/main.cpp Fri Dec 04 11:02:11 2020 +0900
@@ -1,40 +1,39 @@
#include "mbed.h"
DigitalOut led1(LED1);
-Serial pc(USBTX, USBRX);
I2C i2c(D14, D15);
// main() runs in its own thread in the OS
int main() {
char buf[10];
buf[0] = 0;
- pc.printf(" 0 1 2 3 4 5 6 7 8 9 a b c d e f\n");
+ printf(" 0 1 2 3 4 5 6 7 8 9 a b c d e f\n");
for (int adrs = 0; adrs < 0x80; adrs += 16) {
- pc.printf("%02x: ", adrs);
+ printf("%02x: ", adrs);
for (int i = 0; i < 16; i++) {
i2c.write(((adrs + i) << 1), buf, 1);
int ret = i2c.read(((adrs + i) << 1), buf, 2);
if ((adrs+i) == 0 || (adrs+i) == 1 || (adrs+i) == 2) {
- pc.printf(" ");
+ printf(" ");
continue;
}
if ((adrs+i) >= 0x78) {
- pc.printf("\n");
+ printf("\n");
break;
}
if (ret == 1) {
- pc.printf("-- ");
+ printf("-- ");
}
if (ret == 0) {
- pc.printf("%02x ", (adrs + i) << 1);
+ printf("%02x ", (adrs + i) << 1);
}
}
- pc.printf("\n");
+ printf("\n");
}
while (true) {
led1 = !led1;
- wait(0.5);
+ thread_sleep_for(0.5);
}
}
--- a/mbed-os.lib Mon Apr 23 09:31:48 2018 +0000 +++ b/mbed-os.lib Fri Dec 04 11:02:11 2020 +0900 @@ -1,1 +1,1 @@ -https://github.com/ARMmbed/mbed-os/#f9ee4e849f8cbd64f1ec5fdd4ad256585a208360 +https://github.com/ARMmbed/mbed-os/#f2278567d09b9ae9f4843e1d9d393526b9462783 \ No newline at end of file