alpha_datapool
Diff: AlphaTransporter.cpp
- Revision:
- 1:51a5a9f66f61
- Parent:
- 0:2c82568e1790
--- a/AlphaTransporter.cpp Wed Aug 30 05:14:05 2017 +0000 +++ b/AlphaTransporter.cpp Fri Sep 08 03:27:55 2017 +0000 @@ -1,10 +1,9 @@ #include "AlphaTransporter.h" -AlphaTransporter::AlphaTransporter() +AlphaTransporter::AlphaTransporter(I2C *master) : pool(), - i2c(SDA,SCL) + i2c(master) { - } bool AlphaTransporter::set() @@ -14,15 +13,7 @@ i2c.transport_begin(JUSHINKUN_ADDR, pool.ctrl.all_data, 10); no_error = no_error & i2c.read(); i2c.transport_end(); - - i2c.transport_begin(APPER_BODY_ADDR, pool.a.all_data, 1); - no_error = no_error & i2c.write(); - i2c.transport_end(); - - i2c.transport_begin(APPER_BODY_ADDR, pool.ar.all_data, 1); - no_error = no_error & i2c.read(); - i2c.transport_end(); - + pool.up_load(); return no_error;