LED

Dependents:   Semafor Karanovic_Semafor

Committer:
akaranovi
Date:
Sun Nov 29 12:09:03 2020 +0000
Revision:
0:8b4a8e2414db
OK

Who changed what in which revision?

UserRevisionLine numberNew contents of line
akaranovi 0:8b4a8e2414db 1 #include "led.h"
akaranovi 0:8b4a8e2414db 2 #include "mbed.h"
akaranovi 0:8b4a8e2414db 3 LED::LED(PinName pin) : _pin(pin)
akaranovi 0:8b4a8e2414db 4 {
akaranovi 0:8b4a8e2414db 5 _pin = 0;
akaranovi 0:8b4a8e2414db 6 }
akaranovi 0:8b4a8e2414db 7
akaranovi 0:8b4a8e2414db 8 //Metoda određuje stanje LED
akaranovi 0:8b4a8e2414db 9 void LED::status(int status)
akaranovi 0:8b4a8e2414db 10 {
akaranovi 0:8b4a8e2414db 11 _pin = status;
akaranovi 0:8b4a8e2414db 12 }
akaranovi 0:8b4a8e2414db 13
akaranovi 0:8b4a8e2414db 14
akaranovi 0:8b4a8e2414db 15 //Metoda mijenja stanje na LED
akaranovi 0:8b4a8e2414db 16 void LED::flip()
akaranovi 0:8b4a8e2414db 17 {
akaranovi 0:8b4a8e2414db 18 _pin = !_pin;
akaranovi 0:8b4a8e2414db 19 }