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
main.cpp@2:98f6cc48ca3a, 2020-12-11 (annotated)
- Committer:
- KINU
- Date:
- Fri Dec 11 06:47:03 2020 +0000
- Revision:
- 2:98f6cc48ca3a
- Parent:
- 1:03cb3b25065c
0xXX
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ryouheitakamoto | 0:303ad425d2ac | 1 | #include "mbed.h" |
ryouheitakamoto | 0:303ad425d2ac | 2 | |
KINU | 1:03cb3b25065c | 3 | Serial pc(SERIAL_TX, SERIAL_RX); |
KINU | 1:03cb3b25065c | 4 | Serial device(PA_9,PA_10); |
KINU | 2:98f6cc48ca3a | 5 | int main() |
KINU | 2:98f6cc48ca3a | 6 | { |
KINU | 2:98f6cc48ca3a | 7 | |
KINU | 2:98f6cc48ca3a | 8 | while(1) { |
KINU | 2:98f6cc48ca3a | 9 | char c = device.getc(); |
KINU | 1:03cb3b25065c | 10 | |
KINU | 2:98f6cc48ca3a | 11 | if(c == 0x7A) { |
KINU | 2:98f6cc48ca3a | 12 | pc.printf("%02hhx \n",c); |
KINU | 2:98f6cc48ca3a | 13 | if(device.getc() == 0x7A) { |
KINU | 2:98f6cc48ca3a | 14 | pc.printf("%02hhx \n",c); |
KINU | 2:98f6cc48ca3a | 15 | |
KINU | 2:98f6cc48ca3a | 16 | } else if(c == 0x79) { |
KINU | 2:98f6cc48ca3a | 17 | pc.printf("%02hhx \n",c); |
KINU | 2:98f6cc48ca3a | 18 | } |
ryouheitakamoto | 0:303ad425d2ac | 19 | } |
KINU | 2:98f6cc48ca3a | 20 | } |
KINU | 2:98f6cc48ca3a | 21 | |
KINU | 2:98f6cc48ca3a | 22 | |
KINU | 2:98f6cc48ca3a | 23 | |
KINU | 2:98f6cc48ca3a | 24 |