Use the touchpad to enter a passcode, which is either confirmed or rejected, and is displayed on a webpage.

Dependencies:   mbed

Fork of huzzah_helloWorld by ECE 4180 Team Who

Files at this revision

API Documentation at this revision

Comitter:
coleandbrandon
Date:
Wed Mar 16 14:20:11 2016 +0000
Parent:
1:fe195c33f794
Commit message:
Final commit with general code

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed Mar 16 14:14:46 2016 +0000
+++ b/main.cpp	Wed Mar 16 14:20:11 2016 +0000
@@ -28,11 +28,11 @@
 char buf[2024];
 char snd[1024];
  
-char ssid[32] = "TooManyCooks-2.4";     // enter WiFi router ssid inside the quotes
-char pwd [32] = "Lewislovers"; // enter WiFi router password inside the quotes
+char ssid[32] = "SSID";     // enter WiFi router ssid inside the quotes
+char pwd [32] = "PASSWORD"; // enter WiFi router password inside the quotes
 
-int hold0,hold1,hold2,hold3 = 0;
-int signal = 0;
+int hold0,hold1,hold2,hold3 = 0; //signal variables for correct password
+int signal = 0; //signal for correct sequence
  
 void SendCMD(),getreply(),ESPconfig(),ESPsetbaudrate();
  void dev_recv()
@@ -51,7 +51,7 @@
     }
 }
 
-void fallInterrupt() { //code = 4180
+void fallInterrupt() { //code = 4180 (modify by changing "key_code == " statements in each if statement to be new passcode (add 1 each time) 
     int key_code=0;
     int i=0;
     int value=mpr121.read(0x00);
@@ -243,16 +243,16 @@
              interrupt.fall(&fallInterrupt);
             interrupt.mode(PullUp);
        
-             pc.printf("ENTER YOUR PASSWORD IN THE NEXT 10 SECONDS!!");
+             pc.printf("ENTER YOUR PASSWORD IN THE NEXT 10 SECONDS!");
             wait(10);
         
             if (signal ==1){
                 led1 = 1;
-            strcpy(snd, "conn:send(\"<h1> UNLOCKED!.</h1>\")\r\n");
+            strcpy(snd, "conn:send(\"<h1> UNLOCKED!</h1>\")\r\n");
               SendCMD();
             }
             else {
-                strcpy(snd, "conn:send(\"<h1> REJECTED!.</h1>\")\r\n");
+                strcpy(snd, "conn:send(\"<h1> REJECTED!</h1>\")\r\n");
               SendCMD();
             }