Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Konstrukcijski_rad_binarnibrojec_Kelekovic
Revision 0:13bb065c919a, committed 2021-02-19
- Comitter:
- ikelekovi
- Date:
- Fri Feb 19 08:17:37 2021 +0000
- Commit message:
- Digital Output name changed
Changed in this revision
| Blink.cpp | Show annotated file Show diff for this revision Revisions of this file |
| Blink.h | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Blink.cpp Fri Feb 19 08:17:37 2021 +0000
@@ -0,0 +1,19 @@
+#include "Blink.h"
+#include "mbed.h"
+
+LED::LED(PinName pin) : _pin(pin)
+{
+ _pin = 0;
+}
+
+//Metoda kako se određuje stanje LED
+void LED::status(int status)
+{
+ _pin = status;
+}
+
+//Metoda koja mijenja stanje na LED
+void LED::flip()
+{
+ _pin = !_pin;
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Blink.h Fri Feb 19 08:17:37 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 status(int status);
+ void flip();
+private:
+ DigitalOut _pin;
+};
+#endif
\ No newline at end of file