bmsd/ispindels.c

changeset 654
0aef416dbceb
parent 587
31caffee8c9c
child 675
a27af02ab16a
--- a/bmsd/ispindels.c	Thu Apr 16 20:14:02 2020 +0200
+++ b/bmsd/ispindels.c	Fri Apr 17 11:29:37 2020 +0200
@@ -158,7 +158,9 @@
 	snprintf(buf, 64, "%.5f", ispindel->gravity);
         line = xstrcat(line, buf);
         line = xstrcat(line, (char *)",");
-	snprintf(buf, 64, "%.5f", 1 + (ispindel->gravity / (258.6 - ((ispindel->gravity / 258.2) * 227.1))));
+//	snprintf(buf, 64, "%.5f", 1 + (ispindel->gravity / (258.6 - ((ispindel->gravity / 258.2) * 227.1))));
+	snprintf(buf, 64, "%.5f", 1.00001 + (0.0038661 * ispindel->gravity) + (1.3488e-5 * ispindel->gravity * ispindel->gravity) +
+			(4.3074e-8 * ispindel->gravity * ispindel->gravity * ispindel->gravity));
 	line = xstrcat(line, buf);
         line = xstrcat(line, (char *)",");
         snprintf(buf, 64, "%.6f", ispindel->battery);

mercurial