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 /* 00002 * Warning : DON'T SHAKE STRONGLY! 00003 * I have no concern that you break your mbed platforms, your glasses, and so on by your shaking... 00004 */ 00005 00006 #include "mbed.h" 00007 00008 #define LED_ON 0 00009 #define LED_OFF 1 00010 00011 DigitalOut myled_r(LED1); 00012 DigitalOut myled_g(LED2); 00013 DigitalOut myled_b(LED3); 00014 00015 int main() { 00016 int intCounter = 0; 00017 myled_r = myled_g = myled_b = LED_OFF; 00018 while(1) { 00019 if((intCounter&0x1) == 0x1) 00020 myled_r = LED_ON; 00021 else 00022 myled_r = LED_OFF; 00023 00024 if((intCounter&0x2) == 0x2) 00025 myled_g = LED_ON; 00026 else 00027 myled_g = LED_OFF; 00028 00029 if((intCounter&0x4) == 0x4) 00030 myled_b = LED_ON; 00031 else 00032 myled_b = LED_OFF; 00033 00034 wait(0.004); 00035 //wait(0.8); 00036 intCounter = (intCounter+1) & 0x7; 00037 } 00038 }
Generated on Fri Aug 12 2022 01:10:55 by
1.7.2