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 #include "rtos.h" 00003 00004 DigitalOut led_red(PTC8); 00005 DigitalOut led_green(PTD0); 00006 DigitalOut led_blue(PTC9); 00007 Serial pc(USBTX, USBRX); 00008 00009 int main() 00010 { 00011 pc.printf("Tell me the RGB LED Color\r\n"); 00012 00013 while (true) { 00014 pc.printf("Red\r\n"); // print the value of variable i 00015 led_red=0; 00016 led_green=1; 00017 led_blue=1; 00018 Thread::wait(1000); // wait a small period of time 00019 pc.printf("Green\r\n"); // print the value of variable i 00020 led_red=1; 00021 led_green=0; 00022 led_blue=1; 00023 Thread::wait(1000); // wait a small period of time 00024 pc.printf("Blue\r\n"); // print the value of variable i 00025 led_red=1; 00026 led_green=1; 00027 led_blue=0; 00028 Thread::wait(1000); // wait a small period of time 00029 00030 } 00031 } 00032
Generated on Thu Jul 14 2022 00:34:08 by
1.7.2