![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
ARM mbed school tutorials Ch.2 sample code
Revision 0:ae27c510d9b9, committed 2015-01-21
- Comitter:
- lingtien5846
- Date:
- Wed Jan 21 09:12:30 2015 +0000
- Commit message:
- ARM mbed school tutorials; Ch.2 LED ladybird
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 Wed Jan 21 09:12:30 2015 +0000 @@ -0,0 +1,53 @@ +#include "mbed.h" + +DigitalOut pwmOut21 (p21); // PwmOut 21 +DigitalOut pwmOut22 (p22); // PwmOut 22 +DigitalOut pwmOut23 (p23); // PwmOut 23 +DigitalOut pwmOut24 (p24); // PwmOut 24 +DigitalOut pwmOut25 (p25); // PwmOut 25 +DigitalOut pwmOut26 (p26); // PwmOut 26 +DigitalOut spi5 (p5); // SPI 5 +DigitalOut spi6 (p6); // SPI 6 + +int main() +{ + while(1) { + pwmOut21 = 1; + pwmOut22 = 1; + pwmOut23 = 1; + pwmOut24 = 1; + pwmOut25 = 1; + pwmOut26 = 1; + spi5 = 1; + spi6 = 1; + wait(0.5); + pwmOut21 = 0; + pwmOut22 = 0; + pwmOut23 = 0; + pwmOut24 = 0; + pwmOut25 = 0; + pwmOut26 = 0; + spi5 = 0; + spi6 = 0; + wait(0.5); + } +} + +/* +void turnOnLed() { + pwmOut21 = 1; + pwmOut22 = 1; + pwmOut23 = 1; + pwmOut24 = 1; + pwmOut25 = 1; + pwmOut26 = 1; +} + +void turnOffLed() { + pwmOut21 = 0; + pwmOut22 = 0; + pwmOut23 = 0; + pwmOut24 = 0; + pwmOut25 = 0; + pwmOut26 = 0; +}*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Jan 21 09:12:30 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/4fc01daae5a5 \ No newline at end of file