APP3 / Zigbee_communication

Dependents:   Coordinator_node Router_node

Revision:
8:ba349a2eeb37
Parent:
7:78985e92c1c5
Child:
9:902d0f74333c
Child:
14:b8d037ec02d3
--- a/xbee.cpp	Tue Feb 14 04:05:53 2017 +0000
+++ b/xbee.cpp	Tue Feb 14 04:25:55 2017 +0000
@@ -29,6 +29,7 @@
     {
         *c = '-';
         mail->put(c);
+        i *= -1;
     }
     
     int diviseur = 1;
@@ -38,7 +39,7 @@
     
     while (i / diviseur > 0 && j >= 0)
     {
-        chiffre[j] = (i % modulo)/diviseur;
+        chiffre[j] = (char) (i % modulo)/diviseur;
         modulo *= 10;
         diviseur *= 10;
         j--;
@@ -52,7 +53,7 @@
         {
             numberHasStarted = true;
             c = mail->alloc();
-            *c = chiffre[j];
+            *c = chiffre[j] + 0x30;
             mail->put(c);
         }
         j++;
@@ -269,8 +270,8 @@
     char discovery = comm.getc();
     char checksum;
     
-    pcPrint("Response to transmit # ");
-    printInt((int)id);
+    pcPrint("Response to transmit #");
+    printHexa(id);
     pcPrint(" is : ");
     
     if (status == 0)