Package COBS

Dependencies:   mbed UsaPack

Files at this revision

API Documentation at this revision

Comitter:
cocorlow
Date:
Mon Apr 26 11:59:37 2021 +0000
Parent:
0:6a74f8d2aab2
Commit message:
do not send constantly [slave]

Changed in this revision

UsaPack.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/UsaPack.lib	Sat Apr 24 04:31:18 2021 +0000
+++ b/UsaPack.lib	Mon Apr 26 11:59:37 2021 +0000
@@ -1,1 +1,1 @@
-https://os.mbed.com/users/cocorlow/code/UsaPack/#7d6e751f5986
+https://os.mbed.com/users/cocorlow/code/UsaPack/#526f824b50ef
--- a/main.cpp	Sat Apr 24 04:31:18 2021 +0000
+++ b/main.cpp	Mon Apr 26 11:59:37 2021 +0000
@@ -13,20 +13,20 @@
 int main()
 {
     pack p;
+    int d;
     slave.Subscribe(123, &p);
+    slave.Subscribe(456, &d);
     while (1)
     {
-        for (int i = 0; i < 10; i++)
+        for (int j = 0; j < 10; j++)
         {
-            for (int j = 0; j < 10; j++)
-            {
-                pc.printf("a:%f\r\n", p.a[j]);
-            }
-            for (int j = 0; j < 10; j++)
-            {
-                pc.printf("b:%d\r\n", p.b[j]);
-            }
+            pc.printf("a:%f\r\n", p.a[j]);
         }
-        wait(1.0);
+        for (int j = 0; j < 10; j++)
+        {
+            pc.printf("b:%d\r\n", p.b[j]);
+        }
+        pc.printf("d:%d\r\n", d);
+        wait(0.5);
     }
 }
\ No newline at end of file