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.
Fork of i2c_slave by
slave.h@0:ad4485166cfe, 2014-06-30 (annotated)
- Committer:
- viswachaitanya
- Date:
- Mon Jun 30 11:59:30 2014 +0000
- Revision:
- 0:ad4485166cfe
- Child:
- 1:37d4026fa600
i2c slave version 1
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| viswachaitanya | 0:ad4485166cfe | 1 | #include "mbed.h" |
| viswachaitanya | 0:ad4485166cfe | 2 | I2CSlave slave(p28,p27); //configuring pins p27, p28 as I2Cslave |
| viswachaitanya | 0:ad4485166cfe | 3 | Serial pc (USBTX,USBRX); |
| viswachaitanya | 0:ad4485166cfe | 4 | void split(float); //function to split 4 bcurrentte data |
| viswachaitanya | 0:ad4485166cfe | 5 | void write_to_master(char); //function to write data to master |
| viswachaitanya | 0:ad4485166cfe | 6 | void FUNC_I2C_SLAVE_MAIN() |
| viswachaitanya | 0:ad4485166cfe | 7 | |
| viswachaitanya | 0:ad4485166cfe | 8 | struct SensorData //HK_data_structure |
| viswachaitanya | 0:ad4485166cfe | 9 | { |
| viswachaitanya | 0:ad4485166cfe | 10 | float voltage[10]; |
| viswachaitanya | 0:ad4485166cfe | 11 | float current[10]; |
| viswachaitanya | 0:ad4485166cfe | 12 | float temp[10]; |
| viswachaitanya | 0:ad4485166cfe | 13 | //float Battery[2]; |
| viswachaitanya | 0:ad4485166cfe | 14 | } Sensor; |
