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.
Fork of Keyboard_Interrupt by
main.cpp@0:14317ed79bae, 2015-06-02 (annotated)
- Committer:
- TakamiMa
- Date:
- Tue Jun 02 02:57:51 2015 +0000
- Revision:
- 0:14317ed79bae
- Child:
- 1:5440b3d7f435
Keyboard Interrupt test
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
TakamiMa | 0:14317ed79bae | 1 | #include "mbed.h" |
TakamiMa | 0:14317ed79bae | 2 | |
TakamiMa | 0:14317ed79bae | 3 | DigitalOut myled(LED1); |
TakamiMa | 0:14317ed79bae | 4 | Serial pc(SERIAL_TX, SERIAL_RX); |
TakamiMa | 0:14317ed79bae | 5 | |
TakamiMa | 0:14317ed79bae | 6 | void my_Interrupt(){ |
TakamiMa | 0:14317ed79bae | 7 | char key; |
TakamiMa | 0:14317ed79bae | 8 | key = pc.getc(); |
TakamiMa | 0:14317ed79bae | 9 | pc.printf("Interrupted %c\r\n", key); |
TakamiMa | 0:14317ed79bae | 10 | } |
TakamiMa | 0:14317ed79bae | 11 | |
TakamiMa | 0:14317ed79bae | 12 | int main() { |
TakamiMa | 0:14317ed79bae | 13 | pc.attach(my_Interrupt, Serial::RxIrq); |
TakamiMa | 0:14317ed79bae | 14 | while(1){} |
TakamiMa | 0:14317ed79bae | 15 | } |