4.4 Melodie visualisieren (for Verschachtelt, wait, Array's)

Dependencies:   mbed

Fork of 04-04-Uebung by th.iotkit.ch

main.cpp

Committer:
stefan1691
Date:
2015-02-20
Revision:
1:8cfebdfe977b
Parent:
0:a2dc2e18687d
Child:
2:e9e84dc2bf4e

File content as of revision 1:8cfebdfe977b:

/** 4.4 Melodie visualisieren (for Verschachtelt, wait, Array's)
*/
#include "mbed.h"

DigitalOut led[] =  { DigitalOut( D10 ), DigitalOut( D11 ), DigitalOut( D12 ), DigitalOut( D13 ) };

int m[15][4] = {
                { 1, 0, 0, 1 },
                { 1, 1, 1, 1 },
                { 1, 1, 0, 0 },
                { 0, 1, 0, 1 },
                { 1, 1, 1, 1 },
                { 1, 1, 0, 1 },
                { 1, 0, 0, 1 },
                { 1, 1, 0, 1 },
                { 1, 0, 1, 1 },
                { 0, 0, 0, 1 },
                { 1, 0, 0, 1 },
                { 1, 1, 0, 0 },
                { 1, 0, 0, 1 },
                { 1, 0, 0, 1 },
                { 1, 0, 0, 1 }
            };
                

int main()
{
    while (true) 
    {
        // row
        for ( int r = 0; r < 15; r++ )
        {
            // column
            for ( int c = 0; c < 5; c++ )
                led[c] = m[r] [c];
            wait( 0.2 );
        }
    }
    

}