Smart coffee machine with facial recognition and remote control

Dependencies:   Camera_LS_Y201 EthernetInterface EthernetNetIf HTTPClient SRF05 TextLCD mbed-rtos mbed-src

Revision:
0:43669f623d43
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/purge.cpp	Wed Jan 15 11:09:52 2014 +0000
@@ -0,0 +1,53 @@
+#include "purge.h"
+
+DigitalOut relaisPurge(p7);
+
+void purgerLaMachine()
+{
+    /*bool message_affiche = false;
+    
+    while(!tasseEnPlace())
+    {
+        if(!message_affiche)
+        {
+            afficherAuCentreDeLEcran("Veuillez placer", "un recipient");
+            message_affiche = true;
+        }
+    }*/
+    
+    afficherAuCentreDeLEcran("Purge de", "la machine...");
+    
+    wait(0.1);
+    relaisPurge = 1;
+    wait(0.5);
+    relaisPurge = 0;
+    wait(1);
+    
+    while(capteurChauffeClignotant(0.5, 0.05)); // On attend la fin de la purge
+    afficherAuCentreDeLEcran("Machine purgee !", "");
+    
+    wait(3);
+}
+
+void checkPurge()
+{
+    char reponse[20];
+    
+    // On cherche à savoir si une demande de purge (via Internet) a été effectuée
+    if(envoyerRequete("gestion_purge.php", reponse, 20))
+    {
+        if(reponse[1] == '1')
+        {
+            printf("Check purge : demande\n\r");
+            envoyerRequete("gestion_purge.php?purge_en_cours");
+            
+            if(machineEteinte())
+                allumerMachine();
+            
+            while(capteurChauffeClignotant()); // On attend les éventuelles préparations en cours
+            
+            purgerLaMachine();
+            envoyerRequete("gestion_purge.php?fin_purge");
+        }
+    }
+}
\ No newline at end of file