BAE FRDM

Dependencies:   mbed-rtos mbed

Files at this revision

API Documentation at this revision

Comitter:
greenroshks
Date:
Tue Dec 02 04:38:19 2014 +0000
Parent:
0:8b0d43fe6c05
Commit message:
BAE FRDM final

Changed in this revision

slave.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 8b0d43fe6c05 -r b4bb78a9b92e slave.cpp
--- a/slave.cpp	Wed Sep 10 06:41:21 2014 +0000
+++ b/slave.cpp	Tue Dec 02 04:38:19 2014 +0000
@@ -2,7 +2,7 @@
 #include "HK.h"
  
 extern struct SensorData Sensor;
-I2CSlave slave(A4,A5);                       //configuring pins p27, p28 as I2Cslave
+I2CSlave slave(PTC9,PTC8);                       //configuring pins p27, p28 as I2Cslave
 Serial screen (USBTX,USBRX);
 void write_to_master(char send)                           //function to write data to master
         {
@@ -41,6 +41,7 @@
 //to read data from master       
     if(slave.receive()==WriteGeneral)                   //checking if slave is addressed to write
     {
+      slave.stop();
       Switch_Variable=slave.read();                   //receiving data
       screen.printf("switch variable=%d\n",Switch_Variable);
       slave.stop();                          //reset slave to default receiving state