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:
- silverpanda
- Date:
- 2014-04-14
- Revision:
- 5:03b7c237c4c4
- Parent:
- 4:dfb672184380
- Child:
- 6:78a965b2d2df
File content as of revision 5:03b7c237c4c4:
// Print "Hello World" to the PC #include "mbed.h" #include "shell.h" Ticker messageTicker, scanTicker; bool scanUSBSerialRxFlag; Shell *usbSerialShell; void setScanUSBSerialRxFlag() { scanUSBSerialRxFlag = true; } //----------------------------------------------------------------------------- void initMain() { // increase the baud rate for the USB serial port usbSerialShell = new Shell(115200); // send greeting with first cursor usbSerialShell->sendHelloWorld(); // start polling for characters scanTicker.attach(&setScanUSBSerialRxFlag, 0.01); scanUSBSerialRxFlag = false; } //----------------------------------------------------------------------------- int main() { initMain(); while(true) { // check the flag if(scanUSBSerialRxFlag) { usbSerialShell->scanUSBSerialRx(); scanUSBSerialRxFlag = false; } // give the main loop some time wait(0.02); } } //-----------------------------------------------------------------------------