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.
Fork of Arch_GPIO_Ex4 by
Revision 4:ba523da0d68a, committed 2013-09-17
- Comitter:
- viswesr
- Date:
- Tue Sep 17 01:56:36 2013 +0000
- Parent:
- 3:a72374052938
- Child:
- 5:d035275d4c21
- Commit message:
- BusOut Example : First version
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Sep 16 04:44:20 2013 +0000
+++ b/main.cpp Tue Sep 17 01:56:36 2013 +0000
@@ -1,11 +1,15 @@
#include "mbed.h"
-DigitalOut led(LED1); // Configure LED1 pin as output
-DigitalIn button(P1_14); // Configure P1_14 pin as input
+BusOut onboardLEDs(P1_8,P1_9,P1_10,P1_11); /*P1_8 - P1_11 are LED1 - LED4*/
int main()
{
+ int i;
while(1) {
- led.write(button.read()); /* read the state of input port pin P1_14 and write it to output port pin LED1*/
+ for(i=0; i<16; i++) {
+ onboardLEDs.write(i); /* LED1 is LSB and LED4 is MSB*/
+ wait(0.5);
+ }
+
}
}
