Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
ConfigArray
Date:
Thu Apr 18 10:52:20 2019 +0000
Commit message:
a

Changed in this revision

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 7498829541ff main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Apr 18 10:52:20 2019 +0000
@@ -0,0 +1,44 @@
+#include "mbed.h"                           //header files
+
+DigitalOut myled(LED1);                     //pin declarations
+InterruptIn SwitchPush  (p5);
+InterruptIn ClockIn     (p6);
+DigitalIn   DataIn      (p7);
+
+void SwitchPushFunction(void);              //function prototypes
+void ClockInFunction(void);
+
+int ClockDetect = 0;                        //global variables
+int Detect = 0;
+
+
+int main()                  
+{
+    SwitchPush.fall(&SwitchPushFunction);   //attach function to intturrupt, call function when falling signal seen 
+    ClockIn.fall(&ClockInFunction);
+    while(1)                                //do nothing
+    {
+    }
+}
+
+
+void ClockInFunction(void)
+{
+    wait(0.01);                             //software debouncce
+    if(DataIn ==1)                          //interrupt seen. check other signal
+    {                                       // if its 1, the clockwise detected  
+        myled = 1;                          //if its 0, tehn CCW detected 
+    }
+    else
+    {
+        myled = 0;
+    }    
+}
+
+
+
+void SwitchPushFunction(void)
+{
+    
+    
+}
\ No newline at end of file
diff -r 000000000000 -r 7498829541ff mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Apr 18 10:52:20 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/e95d10626187
\ No newline at end of file