diff options
-rw-r--r-- | actuators/motor/atmostripe.vala | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/actuators/motor/atmostripe.vala b/actuators/motor/atmostripe.vala index b20cc44..81c1d1a 100644 --- a/actuators/motor/atmostripe.vala +++ b/actuators/motor/atmostripe.vala @@ -28,6 +28,11 @@ public class AtmostripeMotorController : SerialDevice, MotorController { nop(); nop(); nop(); + enable(); + } + + ~AtmostripeMotorController() { + disable(); } public bool disable() { @@ -37,6 +42,8 @@ public class AtmostripeMotorController : SerialDevice, MotorController { buf[2] = 0xBA; buf[3] = 0xBE; + log("Atmostripe", LogLevelFlags.LEVEL_DEBUG, "disable"); + write(buf, 4); read(buf, 1); @@ -53,6 +60,8 @@ public class AtmostripeMotorController : SerialDevice, MotorController { buf[2] = 0xBA; buf[3] = 0xBE; + log("Atmostripe", LogLevelFlags.LEVEL_DEBUG, "enable"); + write(buf, 4); read(buf, 1); @@ -69,6 +78,8 @@ public class AtmostripeMotorController : SerialDevice, MotorController { write(buf, 1); read(buf, 1); + log("Atmostripe", LogLevelFlags.LEVEL_DEBUG, "nop"); + if(buf[0] == '.') return true; else @@ -83,6 +94,8 @@ public class AtmostripeMotorController : SerialDevice, MotorController { if(engine > 5) return false; + log("Atmostripe", LogLevelFlags.LEVEL_DEBUG, "set single"); + write(buf, 2); read(buf, 2); @@ -97,6 +110,8 @@ public class AtmostripeMotorController : SerialDevice, MotorController { buf[0] = 0xff; buf[1] = speed; + log("Atmostripe", LogLevelFlags.LEVEL_DEBUG, "set all"); + write(buf, 2); read(buf, 2); |