.

Files at this revision

API Documentation at this revision

Comitter:
Mariobrckovic
Date:
Tue Apr 06 08:24:02 2021 +0000
Commit message:
,

Changed in this revision

led.cpp Show annotated file Show diff for this revision Revisions of this file
led.h Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 324f895054e0 led.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/led.cpp	Tue Apr 06 08:24:02 2021 +0000
@@ -0,0 +1,17 @@
+#include "led.h"
+#include "mbed.h"
+ 
+LED::LED(PinName pin) : _pin(pin)
+{
+    _pin = 0;
+}
+//metoda određivanja stanja led diode
+void LED::stanje(int stanje)
+{
+    _pin = stanje;
+}
+ //metoda promjena stanja led diode
+void LED::promjena()
+{
+    _pin = !_pin;
+}
\ No newline at end of file
diff -r 000000000000 -r 324f895054e0 led.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/led.h	Tue Apr 06 08:24:02 2021 +0000
@@ -0,0 +1,15 @@
+#ifndef MBED_LED_H
+#define MBED_LED_H
+#include "mbed.h"
+ 
+//Klasa za LED koja odreduje funkcije za promjenu stanja
+class LED
+{
+public:
+    LED(PinName pin);
+    void stanje(int stanje);
+    void promjena();
+private:
+    DigitalOut _pin;
+};
+#endif
\ No newline at end of file