kwon soonho
/
test1
LED BLINK
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 00003 //PC_8 red 00004 //PC_9 green 00005 //PC_5 blue 00006 00007 //port init 00008 DigitalOut RED(PC_8); 00009 DigitalOut GREEN(PC_9); 00010 DigitalOut BLUE(PC_5); 00011 00012 int main(void) 00013 { 00014 RED = 0; 00015 GREEN = 0; 00016 BLUE = 0; 00017 00018 while(1) 00019 { 00020 // RED = 1; 00021 // wait(1); //sec 00022 // GREEN = 1; 00023 // wait(1); //sec 00024 BLUE = 1; 00025 // wait(3); //sec 00026 // RED = 0; 00027 // wait(1); //sec 00028 // GREEN = 0; 00029 wait(1); //sec 00030 BLUE = 0; 00031 wait(1); //sec 00032 } 00033 }
Generated on Fri Aug 5 2022 03:17:45 by 1.7.2