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.
Dependencies: mbed
main.cpp
- Committer:
- ethanharstad
- Date:
- 2014-06-01
- Revision:
- 0:3619ce83ea6c
File content as of revision 0:3619ce83ea6c:
#include "mbed.h"
unsigned int counter = 0; // Keep count of lifetime
Serial pc(USBTX, USBRX); // Talk to the computer
void count() {
// Announce lifetime
pc.printf("I have been alive for %i seconds.\n", counter);
counter++; // Count up by 1
}
int main() {
pc.printf("Hello world!\n"); // Say hello
while(true) { // Main loop
count(); // Call our function
wait(1); // Wait for 1 second
} // Repeat
}