2017 hongo b team
Dependents: I2C Alpha_Apper I2C
Revision 1:8076e33b6ba1, committed 2017-09-21
- Comitter:
- Komazawa_sun
- Date:
- Thu Sep 21 04:37:15 2017 +0000
- Parent:
- 0:11209e14c06c
- Commit message:
- add_apper_body
Changed in this revision
diff -r 11209e14c06c -r 8076e33b6ba1 Alpha_ApprI2C_ID.h --- a/Alpha_ApprI2C_ID.h Fri Sep 08 03:27:32 2017 +0000 +++ b/Alpha_ApprI2C_ID.h Thu Sep 21 04:37:15 2017 +0000 @@ -5,6 +5,7 @@ { const int s1_addr = 0x0b; const int s2_addr = 0x0c; + const int s3_addr = 0x0d; enum ID { @@ -16,7 +17,9 @@ r_panta = 0x04, l_panta = 0x05, - rld_t_lim = 0x06 + rld_t_lim = 0x06, + + angle = 0x07, }; enum f_type
diff -r 11209e14c06c -r 8076e33b6ba1 ApprI2CMaster.cpp --- a/ApprI2CMaster.cpp Fri Sep 08 03:27:32 2017 +0000 +++ b/ApprI2CMaster.cpp Thu Sep 21 04:37:15 2017 +0000 @@ -6,6 +6,7 @@ _my_type = my_type_; _master = master_; _addr = addr_; + res_data = 0; } void ApprI2CMaster::write(uint8_t data) @@ -22,7 +23,6 @@ int ApprI2CMaster::read() { char buffer[3] = {}; - int res_data = 0; _master->read(_addr, buffer, 3); @@ -38,10 +38,7 @@ break; }; - return res_data; } - else - { - return res_data; - } + + return res_data; } \ No newline at end of file
diff -r 11209e14c06c -r 8076e33b6ba1 ApprI2CMaster.h --- a/ApprI2CMaster.h Fri Sep 08 03:27:32 2017 +0000 +++ b/ApprI2CMaster.h Thu Sep 21 04:37:15 2017 +0000 @@ -2,7 +2,7 @@ #define APPR_I2C_MASTER_H #include "Alpha_ApprI2C_ID.h" -#include "I2CTransporter.h" +#include "mbed.h" class ApprI2CMaster @@ -17,7 +17,7 @@ alpha_a::f_type _my_type; I2C *_master; int _addr; - + int res_data; };