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 Serial pc(USBTX,USBRX,115200); 00003 DigitalOut myled1(LED1); 00004 DigitalOut myled2(LED2); 00005 DigitalOut myled3(LED3); 00006 DigitalOut myled4(LED4); 00007 DigitalOut L1(p5); 00008 DigitalOut L2(p6); 00009 DigitalOut L3(p18); 00010 DigitalIn sw(p7); 00011 00012 Ticker t; 00013 00014 void warikomi(){ 00015 myled3=!myled3; 00016 } 00017 int main() 00018 { 00019 t.attach(&warikomi,1); 00020 while(sw) { 00021 } 00022 while(1) { 00023 pc.printf("%d \r\n",sw.read()); 00024 myled1 = 1; 00025 myled2 = 0; 00026 //myled3 = 1; 00027 myled4 = 0; 00028 L1=1; 00029 L2=0; 00030 L3=1; 00031 wait(0.2); 00032 myled1 = 0; 00033 myled2 = 1; 00034 //myled3 = 0; 00035 myled4 = 1; 00036 L1=0; 00037 L2=1; 00038 L3=0; 00039 wait(0.2); 00040 } 00041 }
Generated on Tue Aug 30 2022 04:54:40 by
1.7.2