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.
Revision 0:af6c8778c6ed, committed 2017-12-07
- Comitter:
- mchheta
- Date:
- Thu Dec 07 19:40:06 2017 +0000
- Commit message:
- sppech access;
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Dec 07 19:40:06 2017 +0000
@@ -0,0 +1,50 @@
+#include "mbed.h"
+#include <stdio.h>
+#include <string.h>
+DigitalOut red(LED1);
+DigitalOut blue(LED3);
+Serial pc(USBTX, USBRX);
+Serial device(PTC15, PTC14);
+unsigned char recivedchar[255];
+int i=0;
+
+int main()
+{
+ red=1;
+ blue=1;
+ unsigned char rx;
+ int sum=0;
+ device.baud(9600);
+ while(1)
+ {
+ if(device.readable())
+ {
+ for(i=0;i<255;i++)
+ {
+ rx = device.getc();
+ recivedchar[i] =rx;
+ sum=sum+rx;
+ pc.printf("%c",rx);
+
+
+ break;
+ }
+ pc.printf("%d",sum);
+ }
+ if(sum==73 || sum==110 || sum==97)
+ {
+ red=1;
+ blue=0;
+ pc.printf("Access Granted!");
+
+ }
+ else
+ {
+ red=0;
+ blue=1;
+
+ }
+ sum=0;
+ }
+
+ }
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Dec 07 19:40:06 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/e7ca05fa8600 \ No newline at end of file