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@0:6898e364f29a, 2014-04-13 (annotated)
- Committer:
- silverpanda
- Date:
- Sun Apr 13 19:03:58 2014 +0000
- Revision:
- 0:6898e364f29a
- Child:
- 1:20033a89af0e
first try
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
silverpanda | 0:6898e364f29a | 1 | // Print "Hello World" to the PC |
silverpanda | 0:6898e364f29a | 2 | |
silverpanda | 0:6898e364f29a | 3 | #include "mbed.h" |
silverpanda | 0:6898e364f29a | 4 | |
silverpanda | 0:6898e364f29a | 5 | Serial usbSerial(USBTX, USBRX); |
silverpanda | 0:6898e364f29a | 6 | |
silverpanda | 0:6898e364f29a | 7 | void sendText(char *thisText) |
silverpanda | 0:6898e364f29a | 8 | { |
silverpanda | 0:6898e364f29a | 9 | usbSerial.printf(thisText); |
silverpanda | 0:6898e364f29a | 10 | } |
silverpanda | 0:6898e364f29a | 11 | //----------------------------------------------------------------------------- |
silverpanda | 0:6898e364f29a | 12 | |
silverpanda | 0:6898e364f29a | 13 | void helloWorld() |
silverpanda | 0:6898e364f29a | 14 | { |
silverpanda | 0:6898e364f29a | 15 | sendText("Hello World\n"); |
silverpanda | 0:6898e364f29a | 16 | } |
silverpanda | 0:6898e364f29a | 17 | //----------------------------------------------------------------------------- |
silverpanda | 0:6898e364f29a | 18 | |
silverpanda | 0:6898e364f29a | 19 | int main() { |
silverpanda | 0:6898e364f29a | 20 | while(true) { |
silverpanda | 0:6898e364f29a | 21 | helloWorld(); |
silverpanda | 0:6898e364f29a | 22 | wait(2.0); |
silverpanda | 0:6898e364f29a | 23 | } |
silverpanda | 0:6898e364f29a | 24 | } |
silverpanda | 0:6898e364f29a | 25 | //----------------------------------------------------------------------------- |