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.
Diff: main.cpp
- Revision:
- 1:75cdcc412104
- Parent:
- 0:f1123578b9b6
--- a/main.cpp Tue Jul 01 08:54:51 2014 +0000
+++ b/main.cpp Sun Jul 06 03:40:22 2014 +0000
@@ -1,12 +1,30 @@
#include "mbed.h"
+
BusOut leds(P1_13, P1_14, P1_22, P0_17, P0_18, P0_19, P1_15, P0_1);
-
-int main() {
- while(1) {
- void single(unsigned char bit);
+void single(unsigned char bit);
+void all();
+void rotate();
+
+int main()
{
- leds = 11 << bit;
+ while(1)
+ {
+ single(0);
+ wait(1);
+ all();
+ single(0);
+ wait(1);
+ rotate();
+ rotate();
+ single(0);
+ wait(1);
+ }
+}
+
+void single(unsigned char bit)
+{
+ leds = 1 << bit;
}
void all()
{
@@ -18,10 +36,10 @@
void rotate()
{
volatile uint8_t i;
- for(i = 0x00; i < 8; i++)
+ for(i =0x00; i < 8; i++)
{
leds = 1 << i;
- wait(0.125);
+ wait(0.25);
}
}
-}
+