pcとのデータのやり取りは確認できた しかしprintfを用いているので正確ではない

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 Serial pc(SERIAL_TX, SERIAL_RX);
00003 //Serial device(PA_9,PA_10);
00004 
00005 DigitalIn dir(PA_10);
00006  
00007 int main()
00008 {
00009     while(1) {
00010         
00011     if(dir)
00012     {
00013       pc.printf("1\r\n");  
00014     }
00015     else
00016     {
00017       pc.printf("0\r\n"); 
00018     }
00019     
00020     }
00021 }