Seri Haberleşme Baud Rate değiştirme

Dependencies:   mbed

Committer:
ctasdemir
Date:
Fri May 11 05:10:45 2018 +0000
Revision:
0:dde3632b5960
Seri Haberle?me Baud Rate de?i?tirme

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ctasdemir 0:dde3632b5960 1 #include "mbed.h"
ctasdemir 0:dde3632b5960 2
ctasdemir 0:dde3632b5960 3 Serial device(USBTX, USBRX); // tx, rx
ctasdemir 0:dde3632b5960 4 int rd = 0;
ctasdemir 0:dde3632b5960 5 int main() {
ctasdemir 0:dde3632b5960 6 device.baud(115200);
ctasdemir 0:dde3632b5960 7 while(1){
ctasdemir 0:dde3632b5960 8 device.printf("Hello World\n");
ctasdemir 0:dde3632b5960 9 rd = device.readable();
ctasdemir 0:dde3632b5960 10 if(rd !=0)
ctasdemir 0:dde3632b5960 11 {
ctasdemir 0:dde3632b5960 12 device.putc(device.getc());
ctasdemir 0:dde3632b5960 13 }
ctasdemir 0:dde3632b5960 14
ctasdemir 0:dde3632b5960 15 wait(1.0);
ctasdemir 0:dde3632b5960 16 }
ctasdemir 0:dde3632b5960 17 }