summaryrefslogtreecommitdiffstats
path: root/kernel/code/radiator.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/code/radiator.c')
-rw-r--r--kernel/code/radiator.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/kernel/code/radiator.c b/kernel/code/radiator.c
new file mode 100644
index 0000000..2d594da
--- /dev/null
+++ b/kernel/code/radiator.c
@@ -0,0 +1,34 @@
+#include <stdio.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include "radiator.h"
+
+int
+main (int argc, char *argv[])
+{
+ Radiator *r;
+ int pos;
+ char buf[1024];
+
+
+ r = radiator_open (argv[1],0);
+
+ if (!r)
+ return -1;
+
+
+ for (;;)
+ {
+ printf ("Current position %d (end stop at %d, overshoots by %d)\n",
+ r->pos, r->max, r->overshoot);
+ printf ("Enter new>");
+ fflush (stdout);
+ buf[sizeof (buf) - 1] = 0;
+ fgets (buf, sizeof (buf) - 1, stdin);
+ radiator_set_pos (r, atoi (buf));
+ }
+
+
+ return 0;
+}