16進数

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 Serial pc(SERIAL_TX, SERIAL_RX);
00004 Serial device(PA_9,PA_10);
00005 int main()
00006 {
00007 
00008     while(1) {
00009         char c = device.getc();
00010 
00011         if(c == 0x7A) {
00012              pc.printf("%02hhx \n",c);
00013              if(device.getc() == 0x7A) {
00014              pc.printf("%02hhx \n",c);
00015            
00016         } else if(c == 0x79) {
00017             pc.printf("%02hhx \n",c);
00018         }
00019     }
00020 }
00021 
00022 
00023  
00024