controlli aggiunti

Dependents:   MX106-custom

Fork of AX12 by Chris Styles

Files at this revision

API Documentation at this revision

Comitter:
clynamen
Date:
Wed Apr 27 18:33:35 2016 +0000
Parent:
5:04c4615a2221
Commit message:
more debug msgs;

Changed in this revision

AX12.cpp Show annotated file Show diff for this revision Revisions of this file
AX12.h Show annotated file Show diff for this revision Revisions of this file
diff -r 04c4615a2221 -r 9b1b2d5d0a13 AX12.cpp
--- a/AX12.cpp	Tue Apr 26 16:46:33 2016 +0000
+++ b/AX12.cpp	Wed Apr 27 18:33:35 2016 +0000
@@ -28,7 +28,7 @@
 AX12::AX12(PinName tx, PinName rx, int ID)
         : _ax12(tx,rx) {
 
-    _ax12.baud(57600);
+    _ax12.baud(9600);
     _ID = ID;
 }
 
@@ -325,9 +325,9 @@
 
     // Transmit the packet in one burst with no pausing
     for (int i = 0; i<8 ; i++) {
-       // printf("Inizio scrittura numero %d\n",i);
+       printf("Inizio scrittura numero %d\n",i);
         _ax12.putc(TxBuf[i]);
-         //printf("Fine scrittura numero %d\n",i);
+       printf("Fine scrittura numero %d\n",i);
     }
 
     // Wait for the bytes to be transmitted
@@ -340,7 +340,7 @@
         for (int i=0; i<(6+bytes) ; i++) {
              printf("Inizio lettura numero %d\n",i);
             Status[i] = _ax12.getc();
-             printf("Fine lettura numero %d\n",i);
+             printf("Fine lettura numero %d dato: %d\n",i, Status[i]);
         }
 
         // Copy the data from Status into data for return
diff -r 04c4615a2221 -r 9b1b2d5d0a13 AX12.h
--- a/AX12.h	Tue Apr 26 16:46:33 2016 +0000
+++ b/AX12.h	Wed Apr 27 18:33:35 2016 +0000
@@ -159,7 +159,7 @@
      */
     float GetVolts(void);
 
-private :
+public :
 
     SerialHalfDuplex _ax12;
     int _ID;