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:2da7bd349ef0, committed 2015-08-13
- Comitter:
- margadon
- Date:
- Thu Aug 13 09:05:20 2015 +0000
- Commit message:
- IO Ver 1 Test
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 |
diff -r 000000000000 -r 2da7bd349ef0 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Aug 13 09:05:20 2015 +0000 @@ -0,0 +1,65 @@ +// Прога для проверки плат IO + +#include "mbed.h" + +//DigitalOut myled(LED1); +DigitalOut o1(PB_7); +DigitalOut o2(PB_6); +DigitalOut o3(PB_5); +DigitalOut o4(PB_4); +DigitalOut o5(PC_12); +DigitalOut o6(PC_11); +DigitalOut o7(PC_10); +DigitalOut o8(PA_15); + +DigitalOut o9 (PA_12); +DigitalOut o10(PA_11); +DigitalOut o11(PA_10); +DigitalOut o12(PA_9); +DigitalOut o13(PA_8); +DigitalOut o14(PC_9); +DigitalOut o15(PC_8); +DigitalOut o16(PC_3); + +DigitalOut o17(PC_2); +DigitalOut o18(PB_15); +DigitalOut o19(PB_14); +DigitalOut o20(PB_13); +DigitalOut o21(PB_12); +DigitalOut o22(PB_10); +DigitalOut o23(PB_2); +DigitalOut o24(PB_1); + +DigitalOut o25(PB_0); +DigitalOut o26(PC_5); +DigitalOut o27(PC_4); +DigitalOut o28(PA_7); +DigitalOut o29(PA_6); +DigitalOut o30(PA_5); +DigitalOut o31(PA_4); +DigitalOut o32(PA_3); + +void ledsOn(){ + o1=1;o2=1;o3=1;o4=1;o5=1;o6=1;o7=1;o8=1; + o9=1;o10=1;o11=1;o12=1;o13=1;o14=1;o15=1;o16=1; + o17=1;o18=1;o19=1;o20=1;o21=1;o22=1;o23=1;o24=1; + o25=1;o26=1;o27=1;o28=1;o29=1;o30=1;o31=1;o32=1; +} + +void ledsOff(){ + o1=0;o2=0;o3=0;o4=0;o5=0;o6=0;o7=0;o8=0; + o9=0;o10=0;o11=0;o12=0;o13=0;o14=0;o15=0;o16=0; + o17=0;o18=0;o19=0;o20=0;o21=0;o22=0;o23=0;o24=0; + o25=0;o26=0;o27=0;o28=0;o29=0;o30=0;o31=0;o32=0; +} + +int main() { + while(1) { + //myled = 1; // LED is ON + ledsOn(); + wait(0.2); // 200 ms + //myled = 0; // LED is OFF + ledsOff(); + wait(0.8); // 1 sec + } +}
diff -r 000000000000 -r 2da7bd349ef0 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Aug 13 09:05:20 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/487b796308b0 \ No newline at end of file