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.
Revision 0:5a5324ce2527, committed 2017-11-14
- Comitter:
- baxterja
- Date:
- Tue Nov 14 20:48:03 2017 +0000
- Commit message:
- Turn LED's on and off sequentially every millisecond
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 5a5324ce2527 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Nov 14 20:48:03 2017 +0000 @@ -0,0 +1,28 @@ +#include "mbed.h" + +DigitalOut gpo(D0); +DigitalOut led(LED_RED); + +#define NUM_LED 14 +#define TimerInterruptInMicroSeconds 1000 +DigitalOut LED_List[NUM_LED] = {D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13}; +Ticker timer0; + + +void ISR_repeat() { + static int counter = 0; + LED_List[counter] = !LED_List[counter]; + counter++; + counter%=NUM_LED; + LED_List[counter] = !LED_List[counter]; + +} + +int main() +{ + for(int i = 0; i<NUM_LED; i++) + LED_List[i]=0; + LED_List[0]=1; + timer0.attach_us(&ISR_repeat, TimerInterruptInMicroSeconds); + +} \ No newline at end of file
diff -r 000000000000 -r 5a5324ce2527 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Nov 14 20:48:03 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/e7ca05fa8600 \ No newline at end of file