changes to motor library
Fork of motor by
Diff: motor.cpp
- Branch:
- motorupdate
- Revision:
- 26:c74e70a745ec
- Parent:
- 25:255d169a45e1
- Child:
- 27:98aecf1889ed
diff -r 255d169a45e1 -r c74e70a745ec motor.cpp --- a/motor.cpp Wed Jan 11 11:06:18 2017 +0000 +++ b/motor.cpp Wed Jan 11 11:07:41 2017 +0000 @@ -155,7 +155,7 @@ //float vin = speed(2 - 0.1/tan((theta/0.022222)*(3.14f / 180.0f)); //float vout = speed(2 + 0.1/tan((theta/0.022222)*(3.14f / 180.0f)); - + if(true){ if(leftOrRight){ w1= speed+ deltaW * tune; w2= speed -deltaW * tune; @@ -169,9 +169,21 @@ //w1=vin; //w2=vout; } - + } + else{ + if(leftOrRight){ + + w1=vout; + w2=vin; + + } + else{ + + w1=vin; + w2=vout; + } - + } return; }