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@5:6e873c38d851, 2015-08-14 (annotated)
- Committer:
- julianlab
- Date:
- Fri Aug 14 16:20:45 2015 +0000
- Revision:
- 5:6e873c38d851
- Parent:
- 4:bcff0ab3e0a6
- Child:
- 6:6f6ae72f40c8
Moved led pins to a array and used a loop to cycle through the leds
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
screamer | 0:005629fe3609 | 1 | #include "mbed.h" |
screamer | 0:005629fe3609 | 2 | |
julianlab | 5:6e873c38d851 | 3 | DigitalOut leds[] ={ (D13), (D12), (D11), (D10), (D9) }; |
screamer | 0:005629fe3609 | 4 | |
screamer | 0:005629fe3609 | 5 | int main() { |
julianlab | 5:6e873c38d851 | 6 | |
screamer | 0:005629fe3609 | 7 | while(1) { |
julianlab | 4:bcff0ab3e0a6 | 8 | |
julianlab | 5:6e873c38d851 | 9 | for (int i = 0; i < 5; i++) { |
julianlab | 5:6e873c38d851 | 10 | leds[i] = 1; // LED is ON |
julianlab | 5:6e873c38d851 | 11 | wait(0.1); // 10 ms |
julianlab | 5:6e873c38d851 | 12 | leds[i] = 0; // LED is OFF |
julianlab | 5:6e873c38d851 | 13 | wait(0.1); // 10 ms |
julianlab | 5:6e873c38d851 | 14 | } |
julianlab | 4:bcff0ab3e0a6 | 15 | |
screamer | 0:005629fe3609 | 16 | } |
julianlab | 5:6e873c38d851 | 17 | |
julianlab | 5:6e873c38d851 | 18 | } |