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
00001 /* mbed Microcontroller Library 00002 * Copyright (c) 2018 ARM Limited 00003 * SPDX-License-Identifier: Apache-2.0 00004 */ 00005 00006 #include "mbed.h" 00007 #include "stats_report.h" 00008 00009 DigitalOut led1(LED1); 00010 00011 #define SLEEP_TIME 100 // (msec) 00012 #define PRINT_AFTER_N_LOOPS 20 00013 00014 // main() runs in its own thread in the OS 00015 int main() { 00016 SystemReport sys_state( SLEEP_TIME * PRINT_AFTER_N_LOOPS /* Loop delay time in ms */); 00017 00018 int count = 0; 00019 while (true) { 00020 // Blink LED and wait 0.5 seconds 00021 led1 = !led1; 00022 wait_ms(SLEEP_TIME); 00023 /* 00024 if ((0 == count) || (PRINT_AFTER_N_LOOPS == count)) { 00025 // Following the main thread wait, report on the current system status 00026 sys_state.report_state(); 00027 count = 0; 00028 } 00029 ++count; 00030 */ 00031 } 00032 }
Generated on Sun Jul 17 2022 11:37:09 by
1.7.2