From 684098dccd33bba766833e7ce0de943eb399174f Mon Sep 17 00:00:00 2001 From: NeodarZ Date: Thu, 5 Mar 2015 17:58:18 +0100 Subject: =?UTF-8?q?Ajout=20du=20code=20Arduino=20de=20la=20t=C3=A9l=C3=A9c?= =?UTF-8?q?ommande=20et=20Processing=20du=20menu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Code_Processing_Menu/..png | Bin 0 -> 145 bytes Code_Processing_Menu/0.png | Bin 0 -> 147 bytes Code_Processing_Menu/1.png | Bin 0 -> 143 bytes Code_Processing_Menu/2.png | Bin 0 -> 164 bytes Code_Processing_Menu/3.png | Bin 0 -> 164 bytes Code_Processing_Menu/4.png | Bin 0 -> 170 bytes Code_Processing_Menu/5.png | Bin 0 -> 164 bytes Code_Processing_Menu/6.png | Bin 0 -> 186 bytes Code_Processing_Menu/7.png | Bin 0 -> 158 bytes Code_Processing_Menu/8.png | Bin 0 -> 167 bytes Code_Processing_Menu/9.png | Bin 0 -> 176 bytes Code_Processing_Menu/ChoixPlats.png | Bin 0 -> 1260 bytes Code_Processing_Menu/Code_Processing_Menu.pde | 206 ++++++++++++++++++++++++++ Code_Processing_Menu/Lecture.pde | 28 ++++ Code_Processing_Menu/menu_boissons_1.png | Bin 0 -> 6241 bytes Code_Processing_Menu/menu_boissons_2.png | Bin 0 -> 6296 bytes Code_Processing_Menu/menu_boissons_3.png | Bin 0 -> 6235 bytes Code_Processing_Menu/menu_desserts_1.png | Bin 0 -> 6389 bytes Code_Processing_Menu/menu_desserts_2.png | Bin 0 -> 6477 bytes Code_Processing_Menu/menu_desserts_3.png | Bin 0 -> 6411 bytes Code_Processing_Menu/menu_entree_1.png | Bin 0 -> 6226 bytes Code_Processing_Menu/menu_entree_2.png | Bin 0 -> 6239 bytes Code_Processing_Menu/menu_entree_3.png | Bin 0 -> 6220 bytes Code_Processing_Menu/menu_plats_1.png | Bin 0 -> 6264 bytes Code_Processing_Menu/menu_plats_2.png | Bin 0 -> 6309 bytes Code_Processing_Menu/menu_plats_3.png | Bin 0 -> 6278 bytes Code_Processing_Menu/sketch.properties | 2 + Code_Processing_Menu/validation.png | Bin 0 -> 5722 bytes Code_Processing_Menu/validation_finale.png | Bin 0 -> 5562 bytes "Code_Processing_Menu/\342\202\254.png" | Bin 0 -> 173 bytes 30 files changed, 236 insertions(+) create mode 100644 Code_Processing_Menu/..png create mode 100644 Code_Processing_Menu/0.png create mode 100644 Code_Processing_Menu/1.png create mode 100644 Code_Processing_Menu/2.png create mode 100644 Code_Processing_Menu/3.png create mode 100644 Code_Processing_Menu/4.png create mode 100644 Code_Processing_Menu/5.png create mode 100644 Code_Processing_Menu/6.png create mode 100644 Code_Processing_Menu/7.png create mode 100644 Code_Processing_Menu/8.png create mode 100644 Code_Processing_Menu/9.png create mode 100644 Code_Processing_Menu/ChoixPlats.png create mode 100644 Code_Processing_Menu/Code_Processing_Menu.pde create mode 100644 Code_Processing_Menu/Lecture.pde create mode 100644 Code_Processing_Menu/menu_boissons_1.png create mode 100644 Code_Processing_Menu/menu_boissons_2.png create mode 100644 Code_Processing_Menu/menu_boissons_3.png create mode 100644 Code_Processing_Menu/menu_desserts_1.png create mode 100644 Code_Processing_Menu/menu_desserts_2.png create mode 100644 Code_Processing_Menu/menu_desserts_3.png create mode 100644 Code_Processing_Menu/menu_entree_1.png create mode 100644 Code_Processing_Menu/menu_entree_2.png create mode 100644 Code_Processing_Menu/menu_entree_3.png create mode 100644 Code_Processing_Menu/menu_plats_1.png create mode 100644 Code_Processing_Menu/menu_plats_2.png create mode 100644 Code_Processing_Menu/menu_plats_3.png create mode 100644 Code_Processing_Menu/sketch.properties create mode 100644 Code_Processing_Menu/validation.png create mode 100644 Code_Processing_Menu/validation_finale.png create mode 100644 "Code_Processing_Menu/\342\202\254.png" (limited to 'Code_Processing_Menu') diff --git a/Code_Processing_Menu/..png b/Code_Processing_Menu/..png new file mode 100644 index 0000000..a0466b4 Binary files /dev/null and b/Code_Processing_Menu/..png differ diff --git a/Code_Processing_Menu/0.png b/Code_Processing_Menu/0.png new file mode 100644 index 0000000..38fd29a Binary files /dev/null and b/Code_Processing_Menu/0.png differ diff --git a/Code_Processing_Menu/1.png b/Code_Processing_Menu/1.png new file mode 100644 index 0000000..a490ede Binary files /dev/null and b/Code_Processing_Menu/1.png differ diff --git a/Code_Processing_Menu/2.png b/Code_Processing_Menu/2.png new file mode 100644 index 0000000..a04ab85 Binary files /dev/null and b/Code_Processing_Menu/2.png differ diff --git a/Code_Processing_Menu/3.png b/Code_Processing_Menu/3.png new file mode 100644 index 0000000..1122db7 Binary files /dev/null and b/Code_Processing_Menu/3.png differ diff --git a/Code_Processing_Menu/4.png b/Code_Processing_Menu/4.png new file mode 100644 index 0000000..63399a3 Binary files /dev/null and b/Code_Processing_Menu/4.png differ diff --git a/Code_Processing_Menu/5.png b/Code_Processing_Menu/5.png new file mode 100644 index 0000000..7ddc206 Binary files /dev/null and b/Code_Processing_Menu/5.png differ diff --git a/Code_Processing_Menu/6.png b/Code_Processing_Menu/6.png new file mode 100644 index 0000000..0622a08 Binary files /dev/null and b/Code_Processing_Menu/6.png differ diff --git a/Code_Processing_Menu/7.png b/Code_Processing_Menu/7.png new file mode 100644 index 0000000..2284156 Binary files /dev/null and b/Code_Processing_Menu/7.png differ diff --git a/Code_Processing_Menu/8.png b/Code_Processing_Menu/8.png new file mode 100644 index 0000000..ed04fab Binary files /dev/null and b/Code_Processing_Menu/8.png differ diff --git a/Code_Processing_Menu/9.png b/Code_Processing_Menu/9.png new file mode 100644 index 0000000..2aff7bd Binary files /dev/null and b/Code_Processing_Menu/9.png differ diff --git a/Code_Processing_Menu/ChoixPlats.png b/Code_Processing_Menu/ChoixPlats.png new file mode 100644 index 0000000..b228a3c Binary files /dev/null and b/Code_Processing_Menu/ChoixPlats.png differ 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 new file mode 100644 index 0000000..cf44c32 Binary files /dev/null and b/Code_Processing_Menu/menu_boissons_1.png differ diff --git a/Code_Processing_Menu/menu_boissons_2.png b/Code_Processing_Menu/menu_boissons_2.png new file mode 100644 index 0000000..62e3793 Binary files /dev/null and b/Code_Processing_Menu/menu_boissons_2.png differ diff --git a/Code_Processing_Menu/menu_boissons_3.png b/Code_Processing_Menu/menu_boissons_3.png new file mode 100644 index 0000000..f0669c4 Binary files /dev/null and b/Code_Processing_Menu/menu_boissons_3.png differ diff --git a/Code_Processing_Menu/menu_desserts_1.png b/Code_Processing_Menu/menu_desserts_1.png new file mode 100644 index 0000000..bd544ee Binary files /dev/null and b/Code_Processing_Menu/menu_desserts_1.png differ diff --git a/Code_Processing_Menu/menu_desserts_2.png b/Code_Processing_Menu/menu_desserts_2.png new file mode 100644 index 0000000..1cb7056 Binary files /dev/null and b/Code_Processing_Menu/menu_desserts_2.png differ diff --git a/Code_Processing_Menu/menu_desserts_3.png b/Code_Processing_Menu/menu_desserts_3.png new file mode 100644 index 0000000..4f8fb4c Binary files /dev/null and b/Code_Processing_Menu/menu_desserts_3.png differ diff --git a/Code_Processing_Menu/menu_entree_1.png b/Code_Processing_Menu/menu_entree_1.png new file mode 100644 index 0000000..52015ff Binary files /dev/null and b/Code_Processing_Menu/menu_entree_1.png differ diff --git a/Code_Processing_Menu/menu_entree_2.png b/Code_Processing_Menu/menu_entree_2.png new file mode 100644 index 0000000..9c9109c Binary files /dev/null and b/Code_Processing_Menu/menu_entree_2.png differ diff --git a/Code_Processing_Menu/menu_entree_3.png b/Code_Processing_Menu/menu_entree_3.png new file mode 100644 index 0000000..c2ddb16 Binary files /dev/null and b/Code_Processing_Menu/menu_entree_3.png differ diff --git a/Code_Processing_Menu/menu_plats_1.png b/Code_Processing_Menu/menu_plats_1.png new file mode 100644 index 0000000..77c6efa Binary files /dev/null and b/Code_Processing_Menu/menu_plats_1.png differ diff --git a/Code_Processing_Menu/menu_plats_2.png b/Code_Processing_Menu/menu_plats_2.png new file mode 100644 index 0000000..5c85d4f Binary files /dev/null and b/Code_Processing_Menu/menu_plats_2.png differ diff --git a/Code_Processing_Menu/menu_plats_3.png b/Code_Processing_Menu/menu_plats_3.png new file mode 100644 index 0000000..5b871b2 Binary files /dev/null and b/Code_Processing_Menu/menu_plats_3.png differ 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 new file mode 100644 index 0000000..a8ceffe Binary files /dev/null and b/Code_Processing_Menu/validation.png differ diff --git a/Code_Processing_Menu/validation_finale.png b/Code_Processing_Menu/validation_finale.png new file mode 100644 index 0000000..2a69cc8 Binary files /dev/null and b/Code_Processing_Menu/validation_finale.png differ diff --git "a/Code_Processing_Menu/\342\202\254.png" "b/Code_Processing_Menu/\342\202\254.png" new file mode 100644 index 0000000..4d9fe2a Binary files /dev/null and "b/Code_Processing_Menu/\342\202\254.png" differ -- cgit v1.2.1