Simple example of Classes

Dependencies:   Class1 mbed

Files at this revision

API Documentation at this revision

Comitter:
zer044
Date:
Tue Sep 26 08:44:20 2017 +0000
Commit message:
Example of functions with and without classes

Changed in this revision

Class1.lib Show annotated file Show diff for this revision Revisions of this file
FunctionsStuff.cpp Show annotated file Show diff for this revision Revisions of this file
FunctionsStuff.h Show annotated file Show diff for this revision Revisions of this file
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/Class1.lib	Tue Sep 26 08:44:20 2017 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/zer044/code/Class1/#809707a63c26
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/FunctionsStuff.cpp	Tue Sep 26 08:44:20 2017 +0000
@@ -0,0 +1,10 @@
+#include "mbed.h"
+#include "FastLoop.h"
+
+
+DigitalOut ledy1(p8);
+
+void setLEDstate(int state)
+{
+    ledy1.write(state);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/FunctionsStuff.h	Tue Sep 26 08:44:20 2017 +0000
@@ -0,0 +1,5 @@
+
+
+
+//Include all function headers here
+void setLEDstate(int state);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Sep 26 08:44:20 2017 +0000
@@ -0,0 +1,23 @@
+#include "mbed.h"
+#include "FastLoop.h"
+#include "AClassy.h"
+
+DigitalOut myled(LED1);
+
+int main() {
+    
+    ClassyClass Myclass1;
+    
+    while(1) {
+        myled = 1;
+        wait(0.2);
+        myled = 0;
+        wait(0.2);
+        
+        
+        setLEDstate(1);
+        Myclass1.setLEDstate(1);
+        
+ 
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Sep 26 08:44:20 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/675da3299148
\ No newline at end of file