for_gamma
GammaTransporter.cpp
- Committer:
- Komazawa_sun
- Date:
- 2017-08-18
- Revision:
- 0:519ec302e9b8
- Child:
- 3:8487ffc7b69c
File content as of revision 0:519ec302e9b8:
#include "GammaTransporter.h" GammaTransporter::GammaTransporter() : pool(), i2c(SDA,SCL) { } bool GammaTransporter::set() { bool no_error = true; 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, 4); 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; } int GammaTransporter::read(int index_num) { return pool.data_index[index_num]; } void GammaTransporter::reset() { pool.reset(); }