robot arm demo team / AX-12A

Fork of AX-12A by Jonathan Pickett

Files at this revision

API Documentation at this revision

Comitter:
henryrawas
Date:
Thu Dec 31 20:02:50 2015 +0000
Parent:
7:155ecc801119
Child:
9:705f671a7498
Commit message:
report errors

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
--- a/AX12.cpp	Thu Dec 31 17:47:43 2015 +0000
+++ b/AX12.cpp	Thu Dec 31 20:02:50 2015 +0000
@@ -12,7 +12,7 @@
     _LastPosition= 0.0f;
     _LastTemperature = 0;
     _LastVoltage = 0;
-    _LastError = 0;
+    _LastError = statusValid;
     _LastLoad = 0;
 }
 
@@ -295,3 +295,8 @@
     return (int)_LastError;
 }
 
+bool AX12::HasError()
+{
+    return _LastError != statusValid;
+}
+
--- a/AX12.h	Thu Dec 31 17:47:43 2015 +0000
+++ b/AX12.h	Thu Dec 31 20:02:50 2015 +0000
@@ -127,6 +127,9 @@
     
     // get last error
     virtual int GetLastError();
+   
+    // check if has error
+    virtual bool HasError();
     
     // get node type
     virtual NodePartType GetNodeType();