Nicholas Outram
/
Task131
updated for mbed-os 5.5
main.cpp@1:57dcf2e26432, 2017-07-13 (annotated)
- Committer:
- noutram
- Date:
- Thu Jul 13 14:46:30 2017 +0000
- Revision:
- 1:57dcf2e26432
- Parent:
- 0:2c60e38674e4
updated for mbed-os 5.5
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
noutram | 0:2c60e38674e4 | 1 | #include "mbed.h" |
noutram | 0:2c60e38674e4 | 2 | |
noutram | 0:2c60e38674e4 | 3 | //Create an instance of a Serial object called pc |
noutram | 0:2c60e38674e4 | 4 | //Transmit and receive pins have names USBTX and USBRX |
noutram | 0:2c60e38674e4 | 5 | Serial pc(USBTX, USBRX); |
noutram | 0:2c60e38674e4 | 6 | |
noutram | 0:2c60e38674e4 | 7 | int main() { |
noutram | 0:2c60e38674e4 | 8 | |
noutram | 0:2c60e38674e4 | 9 | //Set the baud rate property (bits persecond) |
noutram | 0:2c60e38674e4 | 10 | pc.baud(9600); |
noutram | 0:2c60e38674e4 | 11 | |
noutram | 0:2c60e38674e4 | 12 | //Call the printf method on pc |
noutram | 0:2c60e38674e4 | 13 | pc.printf("Hello World\n"); |
noutram | 0:2c60e38674e4 | 14 | |
noutram | 0:2c60e38674e4 | 15 | //Run in an infinite loop |
noutram | 0:2c60e38674e4 | 16 | while(1) { |
noutram | 0:2c60e38674e4 | 17 | } |
noutram | 0:2c60e38674e4 | 18 | } |