Mario Barisic
/
TINF_blinky_klase
29.9.2020
Revision 0:2e7c943c07a9, committed 2020-09-29
- Comitter:
- shogu
- Date:
- Tue Sep 29 15:52:57 2020 +0000
- Commit message:
- prvi;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Sep 29 15:52:57 2020 +0000 @@ -0,0 +1,32 @@ +#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(); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Sep 29 15:52:57 2020 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file