
Demonstrates the use of pointers with scanf.
Fork of RawSerial_ex_2 by
main.cpp
- Committer:
- mab5449
- Date:
- 2017-01-19
- Revision:
- 0:3b040f367dd8
- Child:
- 1:3e364d2f184a
File content as of revision 0:3b040f367dd8:
#include "mbed.h" DigitalOut led1(LED1); DigitalOut led2(LED2); Serial pc(USBTX, USBRX); void callback_ex() { // Note: you need to actually read from the serial to clear the RX interrupt printf("%c\n", pc.getc()); led2 = !led2; } int main() { pc.attach(&callback_ex); while (1) { led1 = !led1; wait(0.5); } }