Moj prvi Library, jednostavni primjer titranja LEDice

Files at this revision

API Documentation at this revision

Comitter:
sbartulov
Date:
Thu Nov 19 15:25:21 2020 +0000
Commit message:
Moj prvi Library, primjer titranja LEDice

Changed in this revision

titranje.cpp Show annotated file Show diff for this revision Revisions of this file
titranje.h Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r d224dddbdff6 titranje.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/titranje.cpp	Thu Nov 19 15:25:21 2020 +0000
@@ -0,0 +1,10 @@
+#include "titranje.h"
+#include "mbed.h"
+
+titranje::titranje(PinName pin):ledica(pin) {
+ledica=1;
+}
+void titranje::stanje_ok() {
+ledica=!ledica;
+wait(0.2);
+}
diff -r 000000000000 -r d224dddbdff6 titranje.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/titranje.h	Thu Nov 19 15:25:21 2020 +0000
@@ -0,0 +1,14 @@
+#ifndef TREPTAC_H
+#define TREPTAC_H
+
+#include "mbed.h"
+
+class titranje {
+public:
+titranje(PinName pin);
+void stanje_ok();
+
+private:
+DigitalOut ledica;
+};
+#endif
\ No newline at end of file