Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of LAB10_Oppgave2 by
Revision 1:c3e8496642b4, committed 2015-11-04
- Comitter:
- rlanghbv
- Date:
- Wed Nov 04 19:22:51 2015 +0000
- Parent:
- 0:1fe30bae9dc1
- Child:
- 2:dc9d556924d9
- Commit message:
- Changed to IRQ
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Nov 04 18:56:08 2015 +0000 +++ b/main.cpp Wed Nov 04 19:22:51 2015 +0000 @@ -1,10 +1,20 @@ #include "mbed.h" - + Serial pc(USBTX, USBRX); - -int main() { + +// The pc has sendt a char to us +void pcTxSrialData() +{ char rxData=pc.getc(); + pc.putc(rxData); +} + +int main() +{ + //Listen for serial data from the PC + pc.attach(&callback); + while (1) { - pc.putc(pc.getc()); + wait(1); } }