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
diff -r 000000000000 -r 8161780f82c0 Class1.lib
--- /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
diff -r 000000000000 -r 8161780f82c0 FunctionsStuff.cpp
--- /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
diff -r 000000000000 -r 8161780f82c0 FunctionsStuff.h
--- /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
diff -r 000000000000 -r 8161780f82c0 main.cpp
--- /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);
+        
+ 
+    }
+}
diff -r 000000000000 -r 8161780f82c0 mbed.bld
--- /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