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.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 2:98f6cc48ca3a
- Parent:
- 1:03cb3b25065c
- Child:
- 3:aaeea2abc917
diff -r 03cb3b25065c -r 98f6cc48ca3a main.cpp
--- a/main.cpp Wed Dec 09 14:37:41 2020 +0000
+++ b/main.cpp Fri Dec 11 06:47:03 2020 +0000
@@ -1,33 +1,24 @@
#include "mbed.h"
-#include "stdio.h"
-#include "stdlib.h"
-#include "time.h"
-
Serial pc(SERIAL_TX, SERIAL_RX);
Serial device(PA_9,PA_10);
-//Serial dir(PA_10);
-int main(){
+int main()
+{
+
+ while(1) {
+ char c = device.getc();
- char c;
- //clock_t start = clock();
-
- while(9600) {
- c = device.getc();
- if(c - '0')
- {
- pc.printf("1\r\n");
+ if(c == 0x7A) {
+ pc.printf("%02hhx \n",c);
+ if(device.getc() == 0x7A) {
+ pc.printf("%02hhx \n",c);
+
+ } else if(c == 0x79) {
+ pc.printf("%02hhx \n",c);
+ }
}
- else
- {
- pc.printf("0\r\n");
- }
- }
- /*
- clock_t end = clock();
- const double time = static_cast<double>(end-start) / CLOCKS_PER_SEC;
- printf("time %lf[s]\n",time);
- */
- return 0;
-
-}
\ No newline at end of file
+}
+
+
+
+
\ No newline at end of file