With Lustre

  What do you need ?

You need a robot :

You need the Lustre compiler. You can download it from here.

You need the legolus Perl command (available here), which calls Lustre compiler and adds some C code to interface Lustre user code with LegOS. Install it somewhere in your path.
 
  What to do ?


node mynode (
capteur_1: bool; -- capteur toucher
capteur_2: bool; -- capteur toucher
capteur_3: bool; -- capteur toucher
lumiere_1: bool; -- capteur lumiere
lumiere_2: bool; -- capteur lumiere
lumiere_3: bool; -- capteur lumiere
rotation_1: int; -- compteur 1/16 tour
rotation_2: int; -- compteur 1/16 tour
rotation_3: int -- compteur 1/16 tour)
returns (
Avant_A, Arriere_A :bool ; -- Autorisations aller avant arriere moteur A
Vitesse_A : int; -- Vitesse moteur A de 0 a 255
Avant_B, Arriere_B :bool ; -- Autorisations aller avant arriere moteur B
Vitesse_B : int; -- Vitesse moteur B de 0 a 255
Avant_C, Arriere_C :bool ; -- Autorisations aller avant arriere moteur C
Vitesse_C : int; -- Vitesse moteur C de 0 a 255
Affichage_0 : int; -- Controle de la LED 0 (caractere)
Affichage_1 : int; -- Controle de la LED 1 (caractere)
Affichage_2 : int; -- Controle de la LED 2 (caractere)
Affichage_3 : int; -- Controle de la LED 3 (caractere)
Affichage_4 : int; -- Controle de la LED 4 (caractere)
Affichage_5 : bool; -- Controle de la LED 5 (signe -)
Seuil_1 : int; -- Seuil de dŽtection du capteur lumire 1 (0 a 100)
Seuil_2 : int; -- Seuil de dŽtection du capteur lumire 2 (0 a 100)
Seuil_3 : int -- Seuil de dŽtection du capteur lumire 3 (0 a 100)
);
  • Download LegOS on the robot. You only need to do it once until you remove the batteries.
  •   To do.

    Just do it, and tell me about your experience...

    Christophe
    Christophe.Mauras@ircyn.ec-nantes.fr