![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
ADF mbed sport mode
main.cpp
- Committer:
- dheerajmpai23
- Date:
- 2015-06-26
- Revision:
- 0:bff5b3df0288
File content as of revision 0:bff5b3df0288:
#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; } }