angledfa

Dependents:   kinematics_controlv4 kinematics_control_copyfds Robot_control ShowIt

Fork of AnglePosition by Peter Knoben

Files at this revision

API Documentation at this revision

Comitter:
peterknoben
Date:
Tue Oct 31 14:34:23 2017 +0000
Parent:
0:d7e19af20f93
Child:
2:20afba507e9e
Commit message:
jhkdsg

Changed in this revision

AnglePosition.cpp Show annotated file Show diff for this revision Revisions of this file
AnglePosition.h Show annotated file Show diff for this revision Revisions of this file
--- a/AnglePosition.cpp	Thu Oct 26 10:53:29 2017 +0000
+++ b/AnglePosition.cpp	Tue Oct 31 14:34:23 2017 +0000
@@ -8,11 +8,22 @@
     
 }
 
-float AnglePosition::gettargetposition(double input, int max_range){
+float AnglePosition::gettargetpositionpot(double input, int max_range){
     float target = input * max_range;
     return target;
 }
 
+float AnglePosition::gettargetposition(float input, int max_range){
+    float target;
+    if(input<=max_range && input>=0){
+        target = input;
+    }
+    else{
+        target = target;
+    }
+    return target;
+}
+
 
 float AnglePosition::getreferenceposition(float target, float offset) {
     float  referenceposition = target + offset;
--- a/AnglePosition.h	Thu Oct 26 10:53:29 2017 +0000
+++ b/AnglePosition.h	Tue Oct 31 14:34:23 2017 +0000
@@ -11,7 +11,9 @@
     */
     AnglePosition(void);
     
-    float gettargetposition(double input, int max_range); //potmeter
+    float gettargetpositionpot(double input, int max_range); //potmeter
+    
+    float gettargetposition(float input, int max_range);
     
     float getreferenceposition(float target, float offset);