ADF7023

Dependencies:   mbed

Revision:
0:50e8145889a8
diff -r 000000000000 -r 50e8145889a8 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Jul 09 06:57:06 2015 +0000
@@ -0,0 +1,45 @@
+#include "mbed.h"
+#include<iostream>
+using namespace std;
+#define ENDL "\r" << endl;
+//Output
+DigitalOut gpo(D9);
+void baud(19200);
+//clock
+InterruptIn clk(D8);
+int state=0;
+int j=0;
+int bit=7;
+unsigned char data [] = {0xFF,0xFF,0xFF};
+void change()
+{
+         cout<<"SENDING"<<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" << "\r" << endl;
+        clk.fall(&change);
+    }
+}
\ No newline at end of file