mbedボードテスト LEDアレイ点滅

Dependencies:   mbed

main.cpp

Committer:
manimani3712
Date:
2016-04-14
Revision:
0:f62ce1fbe374

File content as of revision 0:f62ce1fbe374:

#include "mbed.h"

DigitalOut led1(PTE5);
DigitalOut led2(PTE4);
DigitalOut led3(PTE3);
DigitalOut led4(PTE2);
DigitalOut led5(PTB11);
DigitalOut led6(PTB10);
DigitalOut led7(PTB9);
DigitalOut led8(PTB8);

int main() {
    while(1) {
        led1 = 1;
        wait(0.2);
        led1 = 0;
        wait(0.2);        
        led2 = 0;
        wait(0.2);
        led2 = 0;
        wait(0.2);
        led3 = 1;
        wait(0.2);
        led3 = 0;
        wait(0.2);
        led4 = 0;
        wait(0.2);
        led4 = 0;
        wait(0.2);
        led5 = 1;
        wait(0.2);
        led5 = 0;
        wait(0.2);
        led6 = 0;
        wait(0.2);
        led6 = 0;
        wait(0.2);
        led7 = 1;
        wait(0.2);
        led7 = 0;
        wait(0.2);
        led8 = 0;
        wait(0.2);
        led8 = 0;
        wait(0.2);
    }
}