diff options
author | NeodarZ <bretoncorentin44@gmail.com> | 2015-03-05 17:58:18 +0100 |
---|---|---|
committer | NeodarZ <bretoncorentin44@gmail.com> | 2015-03-05 17:58:18 +0100 |
commit | 684098dccd33bba766833e7ce0de943eb399174f (patch) | |
tree | bbb6361676f00d8f6cedebd8c2fad1aefdb546c8 /Code_Processing_Menu | |
parent | 0c108cab25098c2a92d9a936feeb7a11708ed6c8 (diff) | |
download | Robot-Cable-684098dccd33bba766833e7ce0de943eb399174f.tar.xz Robot-Cable-684098dccd33bba766833e7ce0de943eb399174f.zip |
Ajout du code Arduino de la télécommande et Processing du menu
Diffstat (limited to '')
30 files changed, 236 insertions, 0 deletions
diff --git a/Code_Processing_Menu/..png b/Code_Processing_Menu/..png Binary files differnew file mode 100644 index 0000000..a0466b4 --- /dev/null +++ b/Code_Processing_Menu/..png diff --git a/Code_Processing_Menu/0.png b/Code_Processing_Menu/0.png Binary files differnew file mode 100644 index 0000000..38fd29a --- /dev/null +++ b/Code_Processing_Menu/0.png diff --git a/Code_Processing_Menu/1.png b/Code_Processing_Menu/1.png Binary files differnew file mode 100644 index 0000000..a490ede --- /dev/null +++ b/Code_Processing_Menu/1.png diff --git a/Code_Processing_Menu/2.png b/Code_Processing_Menu/2.png Binary files differnew file mode 100644 index 0000000..a04ab85 --- /dev/null +++ b/Code_Processing_Menu/2.png diff --git a/Code_Processing_Menu/3.png b/Code_Processing_Menu/3.png Binary files differnew file mode 100644 index 0000000..1122db7 --- /dev/null +++ b/Code_Processing_Menu/3.png diff --git a/Code_Processing_Menu/4.png b/Code_Processing_Menu/4.png Binary files differnew file mode 100644 index 0000000..63399a3 --- /dev/null +++ b/Code_Processing_Menu/4.png diff --git a/Code_Processing_Menu/5.png b/Code_Processing_Menu/5.png Binary files differnew file mode 100644 index 0000000..7ddc206 --- /dev/null +++ b/Code_Processing_Menu/5.png diff --git a/Code_Processing_Menu/6.png b/Code_Processing_Menu/6.png Binary files differnew file mode 100644 index 0000000..0622a08 --- /dev/null +++ b/Code_Processing_Menu/6.png diff --git a/Code_Processing_Menu/7.png b/Code_Processing_Menu/7.png Binary files differnew file mode 100644 index 0000000..2284156 --- /dev/null +++ b/Code_Processing_Menu/7.png diff --git a/Code_Processing_Menu/8.png b/Code_Processing_Menu/8.png Binary files differnew file mode 100644 index 0000000..ed04fab --- /dev/null +++ b/Code_Processing_Menu/8.png diff --git a/Code_Processing_Menu/9.png b/Code_Processing_Menu/9.png Binary files differnew file mode 100644 index 0000000..2aff7bd --- /dev/null +++ b/Code_Processing_Menu/9.png diff --git a/Code_Processing_Menu/ChoixPlats.png b/Code_Processing_Menu/ChoixPlats.png Binary files differnew file mode 100644 index 0000000..b228a3c --- /dev/null +++ b/Code_Processing_Menu/ChoixPlats.png diff --git a/Code_Processing_Menu/Code_Processing_Menu.pde b/Code_Processing_Menu/Code_Processing_Menu.pde new file mode 100644 index 0000000..a206ce9 --- /dev/null +++ b/Code_Processing_Menu/Code_Processing_Menu.pde @@ -0,0 +1,206 @@ +import processing.serial.*; +Serial monPortamoi; // Create object from Serial class + +PImage Menu_Entree_1; +PImage Menu_Entree_2; +PImage Menu_Entree_3; +PImage Menu_Plats_1; +PImage Menu_Plats_2; +PImage Menu_Plats_3; +PImage Menu_Desserts_1; +PImage Menu_Desserts_2; +PImage Menu_Desserts_3; +PImage Menu_Boissons_1; +PImage Menu_Boissons_2; +PImage Menu_Boissons_3; +PImage Validation; +PImage Validation_Finale; +PImage ChoixPlats; + +PImage NB_0; +PImage NB_1; +PImage NB_2; +PImage NB_3; +PImage NB_4; +PImage NB_5; +PImage NB_6; +PImage NB_7; +PImage NB_8; +PImage NB_9; +PImage NB_p; +PImage NB_e; + + String maChaineRecue; + String[] valeurLueBTG; + String[] valeurLueBTD; + String[] valeurLueBTH; + String[] valeurLueBTB; + String[] valeurLueBTV; + float BTG=0; + float BTD=0; + float BTH=0; + float BTB=0; + float BTV=0; + + // Initialisation des onglets des plats et du bouton validation + int Onglet = 1; + int Plats = 1; + int BoutonValidation = 0; + int MenuChoixNbPlats = 0; + int ChoixNbPlats = 1; + + // Paramétrage du nombre d'assiette à commander à 0 + int Nb_Assiettes_Salades = 0; + int Nb_Assiettes_Pizza = 0; + int Nb_Assiettes_Poisson_Entree = 0; + int Nb_Assiettes_Pates = 0; + int Nb_Assiettes_Frites = 0; + int Nb_Assiettes_Poisson_Plats = 0; + int Nb_Assiettes_Mousse_au_Chocolat = 0; + int Nb_Assiettes_Glace = 0; + int Nb_Assiettes_Crepe = 0; + int Nb_Assiettes_Coca_Cola = 0; + int Nb_Assiettes_Cafe = 0; + int Nb_Assiettes_The = 0; + +void setup() +{ + size(410,451); + String nomDesPortSerieDetecte = Serial.list()[0]; + monPortamoi = new Serial(this, nomDesPortSerieDetecte, 9600); + Menu_Entree_1 = loadImage("menu_entree_1.png"); + Menu_Entree_2 = loadImage("menu_entree_2.png"); + Menu_Entree_3 = loadImage("menu_entree_3.png"); + Menu_Plats_1 = loadImage("menu_plats_1.png"); + Menu_Plats_2 = loadImage("menu_plats_2.png"); + Menu_Plats_3 = loadImage("menu_plats_3.png"); + Menu_Desserts_1 = loadImage("menu_desserts_1.png"); + Menu_Desserts_2 = loadImage("menu_desserts_2.png"); + Menu_Desserts_3 = loadImage("menu_desserts_3.png"); + Menu_Boissons_1 = loadImage("menu_boissons_1.png"); + Menu_Boissons_2 = loadImage("menu_boissons_2.png"); + Menu_Boissons_3 = loadImage("menu_boissons_3.png"); + Validation = loadImage("validation.png"); + Validation_Finale = loadImage("validation_finale.png"); + ChoixPlats = loadImage("ChoixPlats.png"); + NB_0 = loadImage("0.png"); + NB_1 = loadImage("1.png"); + NB_2 = loadImage("2.png"); + NB_3 = loadImage("3.png"); + NB_4 = loadImage("4.png"); + NB_5 = loadImage("5.png"); + NB_6 = loadImage("6.png"); + NB_7 = loadImage("7.png"); + NB_8 = loadImage("8.png"); + NB_9 = loadImage("9.png"); + NB_p = loadImage("..png"); + NB_e = loadImage("€.png"); + background(Menu_Entree_1); +} + +void draw() { + + + + //lecture(); // lecture carte Arduino relié aux touches + + if ( monPortamoi.available() > 0) //pour voir si contenu disponible dans le port série + { + maChaineRecue=monPortamoi.readStringUntil('\n'); + if (maChaineRecue!=null) + { + //background(0); //nettoyage par fond noir + //text(maChaineRecue, 10, 36); + valeurLueBTG = match(maChaineRecue, "BTG(.*?);"); + valeurLueBTD = match(maChaineRecue, "BTD(.*?);"); + valeurLueBTH = match(maChaineRecue, "BTH(.*?);"); + valeurLueBTB = match(maChaineRecue, "BTB(.*?);"); + valeurLueBTV = match(maChaineRecue, "BTV(.*?);"); + BTG=int(valeurLueBTG[1]);//);//changer la chaine extraite en valeur + BTD=int(valeurLueBTD[1]);//);//changer la chaine extraite en valeur + BTH=int(valeurLueBTH[1]);//);//changer la chaine extraite en valeur + BTB=int(valeurLueBTB[1]);//);//changer la chaine extraite en valeur + BTV=int(valeurLueBTV[1]);//);//changer la chaine extraite en valeur + } //fin si la chaine recue n'est pas nulle + + } //fin si le buffer série n'est pas vide + + + + if (BTG == 1){Onglet = Onglet - 1;delay(500);} + if (BTD == 1){Onglet = Onglet + 1;delay(500);} + + + + if (BTH == 1){Plats = Plats - 1;delay(500);} + if (BTB == 1){Plats = Plats + 1;delay(500);} + + if (BTV == 1){BoutonValidation = 1;} + + if (Onglet <= 0){background(Menu_Boissons_1);Onglet = 5;} + if (Onglet == 5){background(Validation);} + if (Onglet >= 6){background(Menu_Entree_1);Onglet = 1;} + + // Déplacement du "curseur" sur les plats de l'onglet entrée + if (Plats <= 0 && Onglet == 1){background(Menu_Entree_3);Plats = 3;} + if (Plats == 1 && Onglet == 1){background(Menu_Entree_1); + if (BoutonValidation == 1){MenuChoixNbPlats = 1;println("Val 1 = "+BoutonValidation);} + } + if (Plats == 2 && Onglet == 1){background(Menu_Entree_2);} + if (Plats == 3 && Onglet == 1){background(Menu_Entree_3);} + if (Plats >= 4 && Onglet == 1){background(Menu_Entree_1);Plats = 1;} + + // Déplacement du "curseur" sur les plats de l'onglet plats + if (Plats <= 0 && Onglet == 2){background(Menu_Plats_3);Plats = 3;} + if (Plats == 1 && Onglet == 2){background(Menu_Plats_1);} + if (Plats == 2 && Onglet == 2){background(Menu_Plats_2);} + if (Plats == 3 && Onglet == 2){background(Menu_Plats_3);} + if (Plats >= 4 && Onglet == 2){background(Menu_Plats_1);Plats = 1;} + + // Déplacement du "curseur" sur les plats de l'onglet desserts + if (Plats <= 0 && Onglet == 3){background(Menu_Desserts_3);Plats = 3;} + if (Plats == 1 && Onglet == 3){background(Menu_Desserts_1);} + if (Plats == 2 && Onglet == 3){background(Menu_Desserts_2);} + if (Plats == 3 && Onglet == 3){background(Menu_Desserts_3);} + if (Plats >= 4 && Onglet == 3){background(Menu_Desserts_1);Plats = 1;} + + // Déplacement du "curseur" sur les plats de l'onglet boissons + if (Plats <= 0 && Onglet == 4){background(Menu_Boissons_3);Plats = 3;} + if (Plats == 1 && Onglet == 4){background(Menu_Boissons_1);} + if (Plats == 2 && Onglet == 4){background(Menu_Boissons_2);} + if (Plats == 3 && Onglet == 4){background(Menu_Boissons_3);} + if (Plats >= 4 && Onglet == 4){background(Menu_Boissons_1);Plats = 1;} + + // Menu validation finale + if (BoutonValidation == 1 && Onglet == 5){background(Validation_Finale);} + + if (MenuChoixNbPlats == 1){image(ChoixPlats,89,187); + Plats = 1; + Onglet = 1; + image(NB_0,281,236); //x,y + + + if (BTH == 1){ChoixNbPlats = ChoixNbPlats + 1;delay(100);} + if (BTB == 1){ChoixNbPlats = ChoixNbPlats - 1;delay(100);} + if (ChoixNbPlats <= -1){ChoixNbPlats = 0;} + if (ChoixNbPlats == 0){image(NB_0,281,236);} + if (ChoixNbPlats == 1){image(NB_1,281,236);} + if (ChoixNbPlats == 2){image(NB_2,281,236);} + if (ChoixNbPlats == 3){image(NB_3,281,236);} + if (ChoixNbPlats == 4){image(NB_4,281,236);} + if (ChoixNbPlats == 5){image(NB_5,281,236);} + if (ChoixNbPlats == 6){image(NB_6,281,236);} + if (ChoixNbPlats == 7){image(NB_7,281,236);} + if (ChoixNbPlats == 8){image(NB_8,281,236);} + if (ChoixNbPlats == 9){image(NB_9,281,236);} + if (ChoixNbPlats >= 10){ChoixNbPlats = 9;} + if + if (BTV == 1){println("Val 2 = "+BoutonValidation);delay(100);BoutonValidation = 0;background(Menu_Entree_2);Onglet = 1;Plats = 2;println("Val 3 = "+BoutonValidation);} + } +} + +void delay(int delay) +{ + int time = millis(); + while(millis() - time <= delay); +} diff --git a/Code_Processing_Menu/Lecture.pde b/Code_Processing_Menu/Lecture.pde new file mode 100644 index 0000000..cfee47e --- /dev/null +++ b/Code_Processing_Menu/Lecture.pde @@ -0,0 +1,28 @@ +/* +LECTURE DES NOTES ENVOYEES DEPUIS L'ARDUINO + + +void lecture() // Lecture d'une note depuis le port série à réception d'unen valeur de fréquence +{ + String maChaineRecue; + String[] valeurLueBTG; + String[] valeurLueBTD; + float BTG=0; + float BTD=0; + if ( monPortamoi.available() > 0) //pour voir si contenu disponible dans le port série + { + maChaineRecue=monPortamoi.readStringUntil('\n'); + if (maChaineRecue!=null) + { + background(0); //nettoyage par fond noir + //text(maChaineRecue, 10, 36); + valeurLueBTG = match(maChaineRecue, "BTG(.*?);"); + valeurLueBTD = match(maChaineRecue, "BTD(.*?);"); + BTG=int(valeurLueBTG[1]);//);//changer la chaine extraite en valeur + BTD=int(valeurLueBTD[1]);//);//changer la chaine extraite en valeur + } //fin si la chaine recue n'est pas nulle + + } //fin si le buffer série n'est pas vide + +} +*/ diff --git a/Code_Processing_Menu/menu_boissons_1.png b/Code_Processing_Menu/menu_boissons_1.png Binary files differnew file mode 100644 index 0000000..cf44c32 --- /dev/null +++ b/Code_Processing_Menu/menu_boissons_1.png diff --git a/Code_Processing_Menu/menu_boissons_2.png b/Code_Processing_Menu/menu_boissons_2.png Binary files differnew file mode 100644 index 0000000..62e3793 --- /dev/null +++ b/Code_Processing_Menu/menu_boissons_2.png diff --git a/Code_Processing_Menu/menu_boissons_3.png b/Code_Processing_Menu/menu_boissons_3.png Binary files differnew file mode 100644 index 0000000..f0669c4 --- /dev/null +++ b/Code_Processing_Menu/menu_boissons_3.png diff --git a/Code_Processing_Menu/menu_desserts_1.png b/Code_Processing_Menu/menu_desserts_1.png Binary files differnew file mode 100644 index 0000000..bd544ee --- /dev/null +++ b/Code_Processing_Menu/menu_desserts_1.png diff --git a/Code_Processing_Menu/menu_desserts_2.png b/Code_Processing_Menu/menu_desserts_2.png Binary files differnew file mode 100644 index 0000000..1cb7056 --- /dev/null +++ b/Code_Processing_Menu/menu_desserts_2.png diff --git a/Code_Processing_Menu/menu_desserts_3.png b/Code_Processing_Menu/menu_desserts_3.png Binary files differnew file mode 100644 index 0000000..4f8fb4c --- /dev/null +++ b/Code_Processing_Menu/menu_desserts_3.png diff --git a/Code_Processing_Menu/menu_entree_1.png b/Code_Processing_Menu/menu_entree_1.png Binary files differnew file mode 100644 index 0000000..52015ff --- /dev/null +++ b/Code_Processing_Menu/menu_entree_1.png diff --git a/Code_Processing_Menu/menu_entree_2.png b/Code_Processing_Menu/menu_entree_2.png Binary files differnew file mode 100644 index 0000000..9c9109c --- /dev/null +++ b/Code_Processing_Menu/menu_entree_2.png diff --git a/Code_Processing_Menu/menu_entree_3.png b/Code_Processing_Menu/menu_entree_3.png Binary files differnew file mode 100644 index 0000000..c2ddb16 --- /dev/null +++ b/Code_Processing_Menu/menu_entree_3.png diff --git a/Code_Processing_Menu/menu_plats_1.png b/Code_Processing_Menu/menu_plats_1.png Binary files differnew file mode 100644 index 0000000..77c6efa --- /dev/null +++ b/Code_Processing_Menu/menu_plats_1.png diff --git a/Code_Processing_Menu/menu_plats_2.png b/Code_Processing_Menu/menu_plats_2.png Binary files differnew file mode 100644 index 0000000..5c85d4f --- /dev/null +++ b/Code_Processing_Menu/menu_plats_2.png diff --git a/Code_Processing_Menu/menu_plats_3.png b/Code_Processing_Menu/menu_plats_3.png Binary files differnew file mode 100644 index 0000000..5b871b2 --- /dev/null +++ b/Code_Processing_Menu/menu_plats_3.png diff --git a/Code_Processing_Menu/sketch.properties b/Code_Processing_Menu/sketch.properties new file mode 100644 index 0000000..8630fa2 --- /dev/null +++ b/Code_Processing_Menu/sketch.properties @@ -0,0 +1,2 @@ +mode.id=processing.mode.java.JavaMode +mode=Java diff --git a/Code_Processing_Menu/validation.png b/Code_Processing_Menu/validation.png Binary files differnew file mode 100644 index 0000000..a8ceffe --- /dev/null +++ b/Code_Processing_Menu/validation.png diff --git a/Code_Processing_Menu/validation_finale.png b/Code_Processing_Menu/validation_finale.png Binary files differnew file mode 100644 index 0000000..2a69cc8 --- /dev/null +++ b/Code_Processing_Menu/validation_finale.png diff --git a/Code_Processing_Menu/€.png b/Code_Processing_Menu/€.png Binary files differnew file mode 100644 index 0000000..4d9fe2a --- /dev/null +++ b/Code_Processing_Menu/€.png |