i2c master with interrupt

Dependencies:   mbed

Fork of freemaster2_1 by Seeker of Truth ,

Revision:
1:8e4b5e1f8039
Parent:
0:9ea68477caaf
Child:
2:2dd5bd9a64fb
--- a/main.cpp	Sat Dec 06 06:22:50 2014 +0000
+++ b/main.cpp	Mon Dec 08 03:54:47 2014 +0000
@@ -13,11 +13,13 @@
             char *data =  new char;
             *data = 'b';
             bool loopvariable0 = true;
-            while(loopvariable0){
-                printf("2 master clk freq setup and addressing slave\n\r");
-                master.frequency(100000);                       //set clock frequency
+             master.frequency(100000);                       //set clock frequency
+             //master.start();
+            while(ack0){
+                //printf("2 master clk freq setup and addressing slave\n\r");
+               
                 master.start();                                 //initiating the data transfer
-                ack0 = (bool) master.read(addr,data,1);
+                ack0 = (bool) master.read(addr,data,1);}
                 if(!ack0){
                     printf("3 master has read %c from slave\n\r",*data);
                     loopvariable0=false;
@@ -26,4 +28,4 @@
             printf("done\n\r");
         }
     }
-}           
\ No newline at end of file
+           
\ No newline at end of file