.
Dependencies: SHT3XA mbed LIS3DH mbed-rtos USBDevice
main.cpp@0:941291e23892, 2017-08-03 (annotated)
- Committer:
- bcostm
- Date:
- Thu Aug 03 13:27:41 2017 +0000
- Revision:
- 0:941291e23892
- Child:
- 1:323175fe9443
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bcostm | 0:941291e23892 | 1 | #include "mbed.h" |
bcostm | 0:941291e23892 | 2 | #include "USBSerial.h" |
bcostm | 0:941291e23892 | 3 | |
bcostm | 0:941291e23892 | 4 | // Virtual USB Serial port |
bcostm | 0:941291e23892 | 5 | USBSerial usb_serial; |
bcostm | 0:941291e23892 | 6 | |
bcostm | 0:941291e23892 | 7 | DigitalOut led(LED1); |
bcostm | 0:941291e23892 | 8 | |
bcostm | 0:941291e23892 | 9 | int main(void) |
bcostm | 0:941291e23892 | 10 | { |
bcostm | 0:941291e23892 | 11 | int i = 0; |
bcostm | 0:941291e23892 | 12 | |
bcostm | 0:941291e23892 | 13 | // Print on STDIO |
bcostm | 0:941291e23892 | 14 | printf("USBDevice Serial started\r\n"); |
bcostm | 0:941291e23892 | 15 | |
bcostm | 0:941291e23892 | 16 | while(1) { |
bcostm | 0:941291e23892 | 17 | |
bcostm | 0:941291e23892 | 18 | // Print on Virtual USB Serial port |
bcostm | 0:941291e23892 | 19 | usb_serial.printf("I am a virtual serial port: %d\r\n", i++); |
bcostm | 0:941291e23892 | 20 | |
bcostm | 0:941291e23892 | 21 | led = !led; |
bcostm | 0:941291e23892 | 22 | wait(0.1); |
bcostm | 0:941291e23892 | 23 | } |
bcostm | 0:941291e23892 | 24 | } |