envio dados para pc por serial

Dependencies:   CANnucleo mbed

Committer:
Crazyaboutmachines
Date:
Thu Jun 30 01:01:37 2016 +0000
Revision:
3:e85c4e4ec947
Parent:
1:e9d1c42a73ae
Envio dados para computador

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bcostm 0:028fac66239d 1 #include "mbed.h"
bcostm 1:e9d1c42a73ae 2
bcostm 1:e9d1c42a73ae 3 //------------------------------------
bcostm 1:e9d1c42a73ae 4 // Hyperterminal configuration
bcostm 1:e9d1c42a73ae 5 // 9600 bauds, 8-bit data, no parity
bcostm 1:e9d1c42a73ae 6 //------------------------------------
bcostm 1:e9d1c42a73ae 7
bcostm 0:028fac66239d 8 Serial pc(SERIAL_TX, SERIAL_RX);
bcostm 0:028fac66239d 9
bcostm 0:028fac66239d 10 DigitalOut myled(LED1);
bcostm 0:028fac66239d 11
bcostm 0:028fac66239d 12 int main() {
bcostm 0:028fac66239d 13 int i = 1;
bcostm 0:028fac66239d 14 pc.printf("Hello World !\n");
bcostm 0:028fac66239d 15 while(1) {
bcostm 0:028fac66239d 16 wait(1);
bcostm 0:028fac66239d 17 pc.printf("This program runs since %d seconds.\n", i++);
bcostm 0:028fac66239d 18 myled = !myled;
bcostm 0:028fac66239d 19 }
bcostm 0:028fac66239d 20 }
bcostm 0:028fac66239d 21