summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Reichel <sre@ring0.de>2012-07-31 01:48:33 +0200
committerSebastian Reichel <sre@ring0.de>2012-07-31 01:48:33 +0200
commit88c3e067d541c193663b5787a3ddfe86318cc0ce (patch)
treee3856509d2688b07357d911dfc8dbc69cf80baee
parenta5b332a28b25d0f333a9dba92d484f1b063e84a0 (diff)
downloadmicrocopterd-88c3e067d541c193663b5787a3ddfe86318cc0ce.tar.bz2
log changes of atmostripe
-rw-r--r--actuators/motor/atmostripe.vala15
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);