Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 1:b4bb78a9b92e, committed 2014-12-02
- 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 |
--- 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