ferney alberto beltran molina
/
UART_IRQ
EJEMPLO 4
main.cpp
- Committer:
- fabeltranm
- Date:
- 2017-10-28
- Revision:
- 0:3c37e1389d2a
- Child:
- 1:216bc483f4f3
File content as of revision 0:3c37e1389d2a:
#include "mbed.h" Serial device(USBTX, USBRX); // tx, rx DigitalOut output1(LED1); // digital output void Rx_interrupt(); void send_line(); void read_line(); // main test program int main() { device.baud(9600); output1=0; // Setup a serial interrupt function to receive data device.attach(&Rx_interrupt, Serial::RxIrq); while(1) { wait_ms(2000); } } // Interupt Routine to read in data from serial port void Rx_interrupt() { output1=1; device.printf("irq\n"); wait_ms(2000); output1=1; return; }