summaryrefslogtreecommitdiff
path: root/i/chuck/src/es/es.cc
diff options
context:
space:
mode:
authordufourj2007-05-18 22:17:45 +0000
committerdufourj2007-05-18 22:17:45 +0000
commitb22bb601a027ad33097f8bd0f3d34bc579718a75 (patch)
treeecf3ba31e48d94363e97f8f1805734453ae0db5a /i/chuck/src/es/es.cc
parent46a85a34f459c13e462a4d4098735fbff26964b7 (diff)
* General:
- commit post hoomologation. * Ai: - add functions to manage sharps, "rouleau", ascensor and fuck the wall. * Motor & Asserv: - update fuck the wall. * Es: - ascensor management; - "rouleau" management. * ToDo: - too much functions to manage the ascensor, simplify!
Diffstat (limited to 'i/chuck/src/es/es.cc')
-rw-r--r--i/chuck/src/es/es.cc44
1 files changed, 28 insertions, 16 deletions
diff --git a/i/chuck/src/es/es.cc b/i/chuck/src/es/es.cc
index 1f32925..9927727 100644
--- a/i/chuck/src/es/es.cc
+++ b/i/chuck/src/es/es.cc
@@ -32,7 +32,7 @@
/// Constructeur
Es::Es (const Config & config)
: proto_ (*this), log_ ("Es"), lcdKeyPressed_ (-1), front_sensor_ (false),
- jackIn_ (false),colorModeBlue_(false)
+ jackIn_ (false),colorModeBlue_(false),ackSharp_(false)
{
// Récupération des valeurs de configuration dans le fichier
@@ -87,7 +87,6 @@ Es::reset (void)
lcdGetKey (lcdKeyStat_);
// XXX Hardcoded value !
setSharpThreshold (1, thresholdSharp_, thresholdSharp_);
- launchSharpDetection ();
log_ ("Es", Log::debug) << "Reset Es done.";
}
@@ -240,24 +239,26 @@ void Es::receive(char command, const Proto::Frame & frame)
//Activation du truk ki monte et descend.
void
-Es::bouge_ascenceur(uint8_t vit,uint8_t tps,uint8_t sens)
+Es::bouge_ascenceur(void)
{
- proto_.send('a',"bbb",vit,tps,0x00);
- for(int cpt=0;cpt<5;cpt++)
- {
- proto_.send('a',"bbb",0xFF,0x05,0x01);
- proto_.send('a',"bbb",0xFF,0x05,0x00);
- }
- proto_.send('a',"bbb",vit,tps,0x01);
- proto_.send('a',"bbb",vit,tps,0x01);
- //faire un static pour savoir la dernière commande.
- //permettra de faire l'inverse en automatique.
+ proto_.send('a',"bbb",0x70,0xde,0x00);
+
+ /*roulo_roule(0x00);*/
+}
+void
+Es::bougeascDown(void)
+{
+proto_.send('a',"bbb",0x60,0xf0,0x01);
+
+
+ /* roulo_roule(0x00);*/
}
+
//le roulo qui roule
void
-Es::roulo_roule(int vit) //je c pas encore trop le type
+Es::roulo_roule(uint8_t vit)
{
proto_.send('R',"b",vit);
}
@@ -276,12 +277,16 @@ Es::setcolorsens(void)
}
}
-
+void
+Es::initservo(void)
+{
+ proto_.send('m',"bb",0x02,0x00);
+}
//Le roulo tombe grace au servo
void
Es::roulo_tombe(void)
{
- proto_.send('m',"bb",0x00,0x7b);
+ proto_.send('m',"bb",0x02,0x7b);
}
@@ -293,3 +298,10 @@ Es::launchSharpDetection (void)
setSharpUpdate (2, freqSharp_);
}
+/// Move ascenseur
+void
+Es::moveAsc (int speed, int time, bool up)
+{
+ proto_.send ('a', "bbb", speed, time, up ? 0x0 : 0x1);
+}
+