summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMaxime Hadjinlian2013-05-10 03:35:03 +0200
committerMaxime Hadjinlian2013-05-10 03:35:03 +0200
commitb3ef903ed14bb7c6c3175b300f22e55efc78d46d (patch)
treedb4886a48c278466ebf94ed7962b3e64de461d01
parentb23fa0b6c90ad62f336230cea9e8350862b6269f (diff)
digital/io-hub/src/apbirthday: fix blower speed in cannon fsm
-rw-r--r--digital/io-hub/src/apbirthday/cannon.cc9
-rw-r--r--digital/io-hub/src/apbirthday/cannon.hh2
2 files changed, 6 insertions, 5 deletions
diff --git a/digital/io-hub/src/apbirthday/cannon.cc b/digital/io-hub/src/apbirthday/cannon.cc
index 0ca5b246..8b288f91 100644
--- a/digital/io-hub/src/apbirthday/cannon.cc
+++ b/digital/io-hub/src/apbirthday/cannon.cc
@@ -30,10 +30,12 @@ Cannon::Cannon ()
// Init the cannon and the RGB sensor
}
-inline void Cannon::blower_on ()
+inline void Cannon::blower_on (int speed)
{
// Start the blower
+ // speed is between 0-256 (max->min)
robot->pot_regul.set_wiper(0, 256);
+ robot->pot_regul.set_wiper(1, speed);
}
inline void Cannon::blower_off ()
@@ -61,7 +63,6 @@ FSM_START_WITH (CANNON_TRAP_OFF)
FSM_TRANS (CANNON_TRAP_OFF, init_actuators, CANNON_TRAP_BLOCK)
{
- robot->pot_regul.set_wiper (1, 23);
Cannon::set_servo_pos (Cannon::BLOCK);
}
@@ -102,7 +103,7 @@ FSM_START_WITH (CANNON_OFF)
FSM_TRANS (CANNON_OFF, init_actuators, CANNON_PURGING)
{
// Start the blower to purge the canon
- robot->cannon.blower_on ();
+ robot->cannon.blower_on (0);
}
FSM_TRANS_TIMEOUT (CANNON_PURGING, 500, CANNON_READY)
@@ -114,7 +115,7 @@ FSM_TRANS_TIMEOUT (CANNON_PURGING, 500, CANNON_READY)
FSM_TRANS (CANNON_READY, cannon_fire, CANNON_FIRING)
{
// Start the blower
- Cannon::blower_on ();
+ Cannon::blower_on (23);
// Start RGB sensor
robot->rgb.calibrate_cannon_sensor ();
robot->rgb.start_cannon_color ();
diff --git a/digital/io-hub/src/apbirthday/cannon.hh b/digital/io-hub/src/apbirthday/cannon.hh
index fc69bfbe..5cf427de 100644
--- a/digital/io-hub/src/apbirthday/cannon.hh
+++ b/digital/io-hub/src/apbirthday/cannon.hh
@@ -42,7 +42,7 @@ class Cannon
};
// GPIO manipulation.
static void blower_off ();
- static void blower_on ();
+ static void blower_on (int speed);
static void set_servo_pos (int pos);
};