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.
main.cpp@1:ba9bd888e526, 2014-12-02 (annotated)
- Committer:
- okano
- Date:
- Tue Dec 02 03:57:43 2014 +0000
- Revision:
- 1:ba9bd888e526
- Parent:
- 0:09641ab44f00
1st publishing version
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
okano | 1:ba9bd888e526 | 1 | /** I2C_FmPlus library |
okano | 1:ba9bd888e526 | 2 | * |
okano | 1:ba9bd888e526 | 3 | * @class I2C_FmPlus |
okano | 1:ba9bd888e526 | 4 | * @author tedd |
okano | 1:ba9bd888e526 | 5 | * @version 1.0 |
okano | 1:ba9bd888e526 | 6 | * @date 02-Dec-2014 |
okano | 1:ba9bd888e526 | 7 | */ |
okano | 1:ba9bd888e526 | 8 | |
okano | 0:09641ab44f00 | 9 | #include "mbed.h" |
okano | 0:09641ab44f00 | 10 | #include "I2C_FmPlus.h" |
okano | 0:09641ab44f00 | 11 | |
okano | 0:09641ab44f00 | 12 | // I2C i2c( p28, p27 ); |
okano | 0:09641ab44f00 | 13 | I2C_FmPlus i2c( p28, p27 ); |
okano | 0:09641ab44f00 | 14 | |
okano | 1:ba9bd888e526 | 15 | int main() |
okano | 1:ba9bd888e526 | 16 | { |
okano | 0:09641ab44f00 | 17 | char v[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 }; |
okano | 0:09641ab44f00 | 18 | char target_address = 0xC0; |
okano | 1:ba9bd888e526 | 19 | |
okano | 1:ba9bd888e526 | 20 | i2c.frequency( 1000 * 1000 ); |
okano | 0:09641ab44f00 | 21 | |
okano | 0:09641ab44f00 | 22 | while(1) { |
okano | 0:09641ab44f00 | 23 | i2c.write( target_address, v, sizeof( v ) ); |
okano | 0:09641ab44f00 | 24 | } |
okano | 0:09641ab44f00 | 25 | } |