Oving4_4

Dependencies:   mbed

main.cpp

Committer:
olemh88
Date:
2017-09-19
Revision:
1:e3039b96e3e9
Parent:
0:5071536b4cf6

File content as of revision 1:e3039b96e3e9:

#include "mbed.h"

DigitalOut Led1(LED1);
DigitalOut Led2(LED2);
DigitalOut Led3(LED3);
DigitalOut Led4(LED4);
Ticker tick1;
Ticker tick2;
Ticker tick3;
Ticker tick4;
volatile int xx, yy, zz, ee;

void x()
{
    xx = !xx;
}
void y()
{
    yy = !yy;
}
void z()
{
    zz = !zz;
}
void e()
{
    ee = !ee;
}
int main()
{
    tick1.attach(&x,1);
    tick2.attach(&y, 0.3);
    tick3.attach(&z, 0.14);
    tick4.attach(&e, 0.1);
    while(1) {
        Led1 = xx;
        Led2 = yy;
        Led3 = zz;
        Led4 = ee;

    }
}