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.
test.cpp
- Committer:
- daihuku
- Date:
- 2014-07-01
- Revision:
- 1:c4b60ff5a79a
- Parent:
- 0:0da7dd3ebad8
File content as of revision 1:c4b60ff5a79a:
#include "mbed.h"
BusOut leds(P1_13, P1_14, P1_22, P0_17, P0_18, P0_19, P1_15, P0_1);
void single(unsigned char bit);
void all();
void rotate();
void takahiro();
void takahiro2();
int main()
{
while(1)
{
single(0);
wait(2);
all();
all();
rotate();
rotate();
takahiro();
takahiro2();
}
}
void single(unsigned char bit)
{
leds = 1 << bit;
}
void all()
{
leds = 0xff;
wait(0.2);
leds = 0x00;
wait(0.2);
}
void rotate()
{
int bitt;
for(bitt = 0x00; bitt < 10; bitt++)
{
leds = 1 << bitt;
wait(0.2);
}
}
void takahiro()
{
int bitt;
for(bitt = 0x00; bitt < 10; bitt++)
{
leds = 0x80 >> bitt;
wait(0.2);
}
}
void takahiro2()
{
leds = 0x18;
wait(0.5);
leds = 0x24;
wait(0.5);
leds = 0x42;
wait(0.5);
leds = 0x81;
wait(0.5);
}