From cef95354c69745f782a95d37f4b0e7bbf02e106a Mon Sep 17 00:00:00 2001 From: lonkaars Date: Wed, 24 May 2023 18:03:05 +0200 Subject: uart working --- zumo/pidtest/pidtest.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 zumo/pidtest/pidtest.cpp (limited to 'zumo/pidtest/pidtest.cpp') diff --git a/zumo/pidtest/pidtest.cpp b/zumo/pidtest/pidtest.cpp new file mode 100644 index 0000000..4d047fb --- /dev/null +++ b/zumo/pidtest/pidtest.cpp @@ -0,0 +1,18 @@ +#include +#include + +#include "../pid.h" + +int main() { + float P, I, D; + P = -0.02; + I = 0.13; + D = -300; + PID test(P, I, D); + test.reset(0.0); + + fprintf(stderr, "P: %.3f :: I: %.3f :: D: %.3f\n", P, I, D); + for (unsigned int i = 0; i < 100; i++) { + printf("%2.8f\n", test.iter(i < 50 ? 1.0 : 0.0)); + } +} -- cgit v1.2.3