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.
main.cpp
- Committer:
- captaingoujon
- Date:
- 2015-08-18
- Branch:
- dev-USB
- Revision:
- 13:da74d044f6a8
- Parent:
- 4:9bc07cce9fe6
File content as of revision 13:da74d044f6a8:
#include "mbed.h" #include "USBSerial.h" DigitalOut myled(PB_2); InterruptIn usbPower(PA_9); USBSerial pcSerial(0x1f00,0x2012,0x001,false); void usbConnectISR(){ myled=1; } void usbDisconnectISR(){ myled=0; } int main(){ //USB Development branch usbPower.rise(usbConnectISR); usbPower.fall(usbDisconnectISR); usbPower.enable_irq(); pcSerial.printf("USB PORT SERIAL"); while(1){ if(pcSerial.readable()){ pcSerial.putc(pcSerial.getc()); } } }