diff --git a/motion/src/mtn_library.c b/motion/src/mtn_library.c
index b7c143db0d3eac71b8244642b120ccbc6e7c69c0..d0aa1358283a43158975fda4e12a8b86d1326a3a 100644
--- a/motion/src/mtn_library.c
+++ b/motion/src/mtn_library.c
@@ -337,9 +337,9 @@ int compass_deviation (int ini, int actual){ //Calculates the difference between
 
 int add_angles (int a, int b){
 	int res = a+b;
-	if (res < 0 ) res+=360;
-	else if (res>360){
-		res-=360;
+	if (res < 0 ) res+=3600;
+	else if (res>3600){
+		res-=3600;
 	}
 	return res;