Dimple Bhuta / Mbed 2 deprecated mbed_adns9800_v2

Dependencies:   mbed

Fork of mbed_adns9800_simlink_interface by Dimple Bhuta

Files at this revision

API Documentation at this revision

Comitter:
DimpleB05
Date:
Fri Feb 10 08:23:53 2017 +0000
Parent:
7:f723659974c2
Child:
9:5d6b1ac8d5c6
Commit message:
array_stdarr;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri Feb 10 08:09:32 2017 +0000
+++ b/main.cpp	Fri Feb 10 08:23:53 2017 +0000
@@ -72,29 +72,36 @@
 
 void format_and_send()
  {  
-    for (int i = 0; i < std_index; i++)
+    
+    
+    int outPkt_x [10] = {70, 250, 165, 200,187, 25, 0, 125, 5, 52};
+    
+    for (int k=0; k < 10; k++)
     {
-      arr [i] = 0;
+       for (int i = 0; i < std_index; i++)
+        {
+          arr [i] = 0;
+        }
+        int index = count(outPkt_x[k]); //Count the number of digits in the outPkt_x
+        int length = std_index;
+    
+       while (index--) {
+          length = length-1;
+           arr[length]=outPkt_x[k]%10;
+           outPkt_x[k]/=10;
+        }
+       for (int i=0; i < std_index; i++) // Transfer data
+        {
+          if (i == (std_index-1)){
+             pc.printf("%d,", arr[i]);}
+          else{
+             pc.printf("%d", arr[i]);}
+        }
     }
     
-    int outPkt_x = 4026;
-    int index = count(outPkt_x); //Count the number of digits in the outPkt_x
-    int length = std_index;
-    
-    while (index--) {
-        length = length-1;
-        arr[length]=outPkt_x%10;
-         outPkt_x/=10;
-    }
     
   
-    for (int i=0; i < std_index; i++) // Transfer data
-    {
-     if (i == (std_index-1)){
-     pc.printf("%d,", arr[i]);}
-     else{
-     pc.printf("%d", arr[i]);}
-    }
+   
  }
 
 int main() {