Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of huzzah_helloWorld by
Revision 2:ae7610f4867a, committed 2016-03-16
- 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();
}
