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 /** 06_frdm_uart2 00002 * Simple demo to demonstrate communication via UART2 00003 * 00004 * Hardware requirements: 00005 * - FRDM-KL25Z board 00006 * - USB-UART protocol converter (FTDI cable or similar) 00007 * 00008 * Wiring: 00009 * FTDI RX to PTE22, FTDI TX to PTE23 00010 * FTDI GND to GND, FTDI 5V to Vin 00011 */ 00012 00013 00014 #include "mbed.h" 00015 00016 DigitalOut myled(LED_GREEN); 00017 Serial pc(PTE22, PTE23); 00018 00019 int main() 00020 { 00021 int i = 0; 00022 pc.printf("Hello World!\r\n"); 00023 00024 while (true) { 00025 wait_ms(1000); // wait a small period of time 00026 i++; // increment the variable 00027 myled = !myled; // toggle a led 00028 int s = myled; 00029 pc.printf("%d. ledstate = %d \r\n", i,s); // print variable i and LED state 00030 } 00031 }
Generated on Sat Jul 16 2022 04:46:55 by
1.7.2