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 #include "mbed.h" 00002 00003 /*----------------------------------------------------------------------- 00004 Before to use this example, ensure that you an hyperterminal installed on your computer. 00005 More info here: https://developer.mbed.org/handbook/Terminals 00006 The default serial comm port uses the SERIAL_TX and SERIAL_RX pins (see their definition in the PinNames.h file). 00007 The default serial configuration in this case is 9600 bauds, 8-bit data, no parity. 00008 If you want to change the baudrate for example, you have to redeclare the 00009 serial object in your code: 00010 00011 Serial pc(SERIAL_TX, SERIAL_RX); 00012 00013 Then, you can modify the baudrate and print like this: 00014 00015 pc.baud(115200); 00016 pc.printf("Hello World !\n"); 00017 -------------------------------------------------------------------------*/ 00018 00019 DigitalOut led(LED1); 00020 00021 int main() 00022 { 00023 int i = 1; 00024 00025 printf("Hello World !\n"); 00026 00027 while(1) { 00028 wait(1); // 1 second 00029 led = !led; // Toggle LED 00030 printf("This program runs since %d seconds.\n", i++); 00031 } 00032 }
Generated on Fri Aug 26 2022 11:44:51 by
1.7.2