diff --git a/examples/fullFunction/fullFunction.ino b/examples/fullFunction/fullFunction.ino index 43259ca..ad93fd1 100644 --- a/examples/fullFunction/fullFunction.ino +++ b/examples/fullFunction/fullFunction.ino @@ -79,7 +79,7 @@ void printMenu() float convertRawAngleToDegrees(word newAngle) { /* Raw data reports 0 - 4095 segments, which is 0.087 of a degree */ - float retVal = newAngle * 0.087; + float retVal = newAngle * 0.087890625; return retVal; } @@ -102,20 +102,20 @@ float convertScaledAngleToDegrees(word newAngle) if(maxAngle >0) { if(startPos == 0) - multipler = (maxAngle*0.0878)/4096; + multipler = (maxAngle*0.087890625)/4096; else /*startPos is set to something*/ - multipler = ((maxAngle*0.0878)-(startPos * 0.0878))/4096; + multipler = ((maxAngle*0.087890625)-(startPos * 0.087890625))/4096; } else { if((startPos == 0) && (endPos == 0)) - multipler = 0.0878; + multipler = 0.087890625; else if ((startPos > 0 ) && (endPos == 0)) - multipler = ((360 * 0.0878) - (startPos * 0.0878)) / 4096; + multipler = ((360 * 0.087890625) - (startPos * 0.087890625)) / 4096; else if ((startPos == 0 ) && (endPos > 0)) - multipler = (endPos*0.0878) / 4096; + multipler = (endPos*0.087890625) / 4096; else if ((startPos > 0 ) && (endPos > 0)) - multipler = ((endPos*0.0878)-(startPos * 0.0878))/ 4096; + multipler = ((endPos*0.087890625)-(startPos * 0.087890625))/ 4096; } return (newAngle * multipler); } @@ -330,4 +330,4 @@ void loop() /*end of menu processing */ printMenu(); } -} +} \ No newline at end of file diff --git a/examples/readAngle/readAngle.ino b/examples/readAngle/readAngle.ino index 91cf2d5..13fc8bf 100644 --- a/examples/readAngle/readAngle.ino +++ b/examples/readAngle/readAngle.ino @@ -40,8 +40,8 @@ void setup() /*******************************************************/ float convertRawAngleToDegrees(word newAngle) { - /* Raw data reports 0 - 4095 segments, which is 0.087 of a degree */ - float retVal = newAngle * 0.087; + /* Raw data reports 0 - 4095 segments, which is 0.087890625 of a degree */ + float retVal = newAngle * 0.087890625; return retVal; } void loop()