arduino stuffs
Diffstat (limited to 'steer/steer.ino')
| -rw-r--r-- | steer/steer.ino | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/steer/steer.ino b/steer/steer.ino new file mode 100644 index 0000000..01024a7 --- /dev/null +++ b/steer/steer.ino @@ -0,0 +1,15 @@ +// #include "Streaming.h"
+#include "buttons.h"
+
+#define UPDATE_INTERVAL 5
+
+void setup() { Controller::begin(); }
+
+void loop() {
+ unsigned long time = millis();
+ Controller::send();
+ time = millis() - time; // time elapsed in reading the inputs
+ if (time < UPDATE_INTERVAL)
+ // sleep till it is time for the next update
+ delay(UPDATE_INTERVAL - time);
+}
|