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.
Revision 0:38bf3140be9d, committed 2015-07-31
- Comitter:
- yamasho
- Date:
- Fri Jul 31 01:29:51 2015 +0000
- Commit message:
- Led Shifter Ver 1.00;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Jul 31 01:29:51 2015 +0000 @@ -0,0 +1,51 @@ +#include "mbed.h" + +BusOut myleds(LED1, LED2, LED3, LED4); +BusOut LedsL(p5, p6, p7, p8,p9 ,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19,p20); +BusOut LedsR(p21,p22,p23,p24,p25,p26,p27,p28,p29,p30); +uint32_t dw; +uint8_t b; + +int main() + { + b = 0; + dw = 0; + + while(1) + { + + do{ + b <<= 1; + dw <<= 1; + if(b < 8 ) b |= 1; + if(dw < 8) dw |= 1; + + b = b & 0x0f; + + myleds = b; + LedsL = dw; + LedsR = dw; + wait(0.05); + }while(dw <= 0x8000L); + + + do{ + dw >>= 1; + + if(b == 0 ) b = 8; + else + if(b == 8 ) b = 0xc; + else + if(b == 0xc ) b = 0xe; + else + b >>= 1; + + b = b & 0x0f; + + myleds = b; + LedsL = dw; + LedsR = dw; + wait(0.05); + }while(dw != 0x00007L); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Jul 31 01:29:51 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/bad568076d81 \ No newline at end of file