ece 4180 lab 3

Dependencies:   mbed wave_player mbed-rtos 4DGL-uLCD-SE SDFileSystem X_NUCLEO_53L0A1 HC_SR04_Ultrasonic_Library

part3.h

Committer:
emilywilson
Date:
2020-02-27
Revision:
4:1ef667567942
Parent:
2:4845e2dae429

File content as of revision 4:1ef667567942:

#include "mbed.h"

DigitalOut led1(LED1);
DigitalOut led2(LED2);
DigitalOut led3(LED3);
DigitalOut led4(LED4);

Ticker ticker1;
Ticker ticker2;
Ticker ticker3;
Ticker ticker4;

void flipLED1() {
    led1 = !led1;
}

void flipLED2() {
    led2 = !led2;
}

void flipLED3() {
    led3 = !led3;
}

void flipLED4() {
    led4 = !led4;
}

void run_part3() {
    led1 = 0;
    led2 = 0;
    led3 = 0;
    led4 = 0;
    
    ticker1.attach(&flipLED1, 1.0);
    ticker2.attach(&flipLED2, 2.0);
    ticker3.attach(&flipLED3, 4.0);
    ticker4.attach(&flipLED4, 8.0);
    
    while(1);
}