29.9.2020

Dependencies:   mbed

main.cpp

Committer:
shogu
Date:
2020-09-29
Revision:
0:2e7c943c07a9

File content as of revision 0:2e7c943c07a9:

#include "mbed.h"

//DigitalOut myled(LED1);

class MyLed {
    public:
        MyLed(PinName led) : _led(led) {
            _led = 1;
        }
        
        void ledOn(void) {
            _led = 1;
            wait_ms(500);
        }
        
        MyLed() {};
    
    private:
        DigitalOut _led;
    };
    
MyLed myLed(LED1);
MyLed myLed2(LED2);

int main() {
    while(1) {
        myLed.ledOn();
        myLed.ledOff();
        myLed2.ledOn();
        myLed2.ledOff();
    }
}