summaryrefslogtreecommitdiff
path: root/src/unused/motor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/unused/motor.cpp')
-rw-r--r--src/unused/motor.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/unused/motor.cpp b/src/unused/motor.cpp
new file mode 100644
index 0000000..84785a9
--- /dev/null
+++ b/src/unused/motor.cpp
@@ -0,0 +1,46 @@
+#include "../include/motor.hpp"
+
+
+
+Motor::Motor() {
+
+
+}
+
+bool Motor::init(void* data) {
+
+ Vehicle *vehicle = (Vehicle *) data;
+ double duty = 100 - ((MIN_ANGLE / 180) * vehicle->duty_span + DUTY_MIN);
+
+ // Initialize stuff
+ // .....
+ // .....
+
+
+ data = (void*) vehicle; // Is this necessary?
+ return true;
+}
+
+
+bool Motor::writeData(void* data) {
+
+ Vehicle *vehicle = (Vehicle *) data;
+ double duty = 100 - ((vehicle->deployment_angle / 180) * vehicle->duty_span + DUTY_MIN);
+
+ // Send the Data somewhere
+ // ..... Pin
+ // ..... Duty
+ // ..... PWM frequency Hz
+ // ..... Polarity
+
+
+ if (1 == 2) {
+ Logger::Get().logErr("Some type of Error");
+ return false;
+ }
+
+ data = (void*) vehicle; // Is this necessary?
+ return true;
+}
+
+