ADF mbed sport mode

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
dheerajmpai23
Date:
Fri Jun 26 12:47:20 2015 +0000
Commit message:
My Code -Not working

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Jun 26 12:47:20 2015 +0000
@@ -0,0 +1,48 @@
+
+#include "mbed.h"
+#include<iostream>
+#define ENDL "\r" << endl;
+using namespace std;
+
+//Output
+DigitalOut gpo(D9);
+
+//clock
+InterruptIn clk(D8);
+int state=0;
+int j=0;
+int bit=7;
+unsigned char data [] = {0x55,0x55,0x55};
+void change()
+{
+        cout<<"Clock Detected"<<ENDL;
+        if(bit<0)
+        {
+            j++;
+            bit=7;
+           
+            if(j == 3){
+                j = 0;
+            }
+        }
+        if(state==0)
+        {
+            gpo = (data[j] >> bit--) & 0x01 ;
+            state++;
+        }
+        else if (state==1)
+        {
+            state=0;
+        }
+}           
+       
+int main()
+{  
+    printf("HELLO\r\n");
+    while(true)
+    {
+        cout << "hoo" << ENDL;
+        clk.fall(&change);
+        cout << "finished" << ENDL;
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Jun 26 12:47:20 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/7cff1c4259d7
\ No newline at end of file