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 "leds.h" 00003 #include "timers.h" 00004 00005 TIMER0_INTERRUPT_HANDLER(void) 00006 { 00007 TIMER0_CLEAR_INTERRUPT(MR0_INT); 00008 static int i = 0; 00009 i++; 00010 if(i%2) 00011 LEDS_SET(LED1); 00012 else 00013 LEDS_SET(LED2); 00014 } 00015 00016 int main() { 00017 LEDS_INIT(); 00018 TIMER0_INIT(); 00019 TIMER0_SETPCLK(CCLK); 00020 TIMER0_SETPRESCALE(96000); // 1ms 00021 TIMER0_SETMATCH(0, 100); 00022 TIMER0_SETMATCHCONTROL(0, MATCH_RESET | MATCH_INTERRUPT); // Reset and Interrupt each 100ms 00023 TIMER0_ENABLE_INTERRUPT(); 00024 TIMER0_START(); 00025 while (1); 00026 }
Generated on Mon Jul 18 2022 05:38:41 by
1.7.2