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.
Diff: main.cpp
- Revision:
- 1:e5497e7c8c79
- Parent:
- 0:f6e222782355
- Child:
- 2:292423de1497
--- a/main.cpp	Thu Jul 09 10:17:56 2020 +0000
+++ b/main.cpp	Thu Jul 09 15:42:27 2020 +0000
@@ -9,28 +9,28 @@
 
 int main()
 {
-    char data_read[1];
+    char data_read[128];
     pc.baud(460800);                           //ボーレート変更
     
     pc.printf("Start!");
     
-    for(int i = 0;i < 3000; i++)
+    for(int i = 0;i < 500; i++)
     {
-    rom.write(ADDR, pointerAddress, '\0', 1);        // write tha data
-    pointerAddress = pointerAddress + 1;          //アドレスずらし
+    rom.write(ADDR, pointerAddress, '\0', 128);        // write tha data
+    pointerAddress = pointerAddress + 128;          //アドレスずらし
     }
     
     pointerAddress = 0;
     pc.printf("Data read\r\n");
 
-    for(int n = 0; n < 3000; n++)
+    for(int n = 0; n < 500; n++)
     {
-        rom.read(ADDR, pointerAddress, data_read, 1);
-        wait_ms(10);
+        rom.read(ADDR, pointerAddress, data_read, 128);
+        wait_ms(5);
         pc.printf("%s\r\n", data_read);
 
-        pointerAddress = pointerAddress + 1;         //アドレスずらし
-        memset(data_read, '\0', 1 );                 //初期化
+        pointerAddress = pointerAddress + 128;         //アドレスずらし
+        memset(data_read, '\0', 128 );                 //初期化
     }
     pc.printf("Finish!\r\n");
 }
\ No newline at end of file