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@0:cc5294a00e8a, 2015-11-16 (annotated)
- Committer:
- WardieB
- Date:
- Mon Nov 16 15:46:17 2015 +0000
- Revision:
- 0:cc5294a00e8a
UEA HND COURSE 1
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| WardieB | 0:cc5294a00e8a | 1 | #include "mbed.h" //needs to be here |
| WardieB | 0:cc5294a00e8a | 2 | |
| WardieB | 0:cc5294a00e8a | 3 | // my program to flash leds |
| WardieB | 0:cc5294a00e8a | 4 | // written on 16/11/15 by Ward Broughton |
| WardieB | 0:cc5294a00e8a | 5 | |
| WardieB | 0:cc5294a00e8a | 6 | DigitalOut myled1(LED1); |
| WardieB | 0:cc5294a00e8a | 7 | DigitalOut myled2(LED2); |
| WardieB | 0:cc5294a00e8a | 8 | |
| WardieB | 0:cc5294a00e8a | 9 | int main() { |
| WardieB | 0:cc5294a00e8a | 10 | while(1) { //repeat forever |
| WardieB | 0:cc5294a00e8a | 11 | myled1=1; //led1 on |
| WardieB | 0:cc5294a00e8a | 12 | myled2=0; |
| WardieB | 0:cc5294a00e8a | 13 | wait(1); |
| WardieB | 0:cc5294a00e8a | 14 | |
| WardieB | 0:cc5294a00e8a | 15 | myled2=1; //led2 on |
| WardieB | 0:cc5294a00e8a | 16 | myled1=0; |
| WardieB | 0:cc5294a00e8a | 17 | wait(1); |
| WardieB | 0:cc5294a00e8a | 18 | |
| WardieB | 0:cc5294a00e8a | 19 | myled1=2; //both on |
| WardieB | 0:cc5294a00e8a | 20 | myled2=1; |
| WardieB | 0:cc5294a00e8a | 21 | wait(1); |
| WardieB | 0:cc5294a00e8a | 22 | |
| WardieB | 0:cc5294a00e8a | 23 | } |
| WardieB | 0:cc5294a00e8a | 24 | } |