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:
- 7:19da09fe546b
- Parent:
- 6:78a965b2d2df
File content as of revision 7:19da09fe546b:
// Print "Hello World" to the PC #include "mbed.h" #include "shell.h" #include "LEDColors.h" Ticker *scanTicker; Shell *usbSerialShell; LEDColors *ledColors; bool scanUSBSerialRxFlag; void at10msTick() { scanUSBSerialRxFlag = true; ledColors->tick10ms(); } //----------------------------------------------------------------------------- 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 = new Ticker(); scanTicker->attach(&at10msTick, 0.01); scanUSBSerialRxFlag = false; ledColors = new LEDColors(); } //----------------------------------------------------------------------------- int main() { initMain(); while(true) { // check the flag if(scanUSBSerialRxFlag) { usbSerialShell->scanUSBSerialRx(); scanUSBSerialRxFlag = false; } // give the main loop some time wait(0.02); } } //-----------------------------------------------------------------------------