2017_hongo_Bteam
BetaTransporter.cpp@0:31116bc8d4a7, 2017-08-18 (annotated)
- Committer:
- Komazawa_sun
- Date:
- Fri Aug 18 07:35:50 2017 +0000
- Revision:
- 0:31116bc8d4a7
- Child:
- 1:a2572a29fe59
beta_data_pool
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Komazawa_sun | 0:31116bc8d4a7 | 1 | #include "BetaTransporter.h" |
Komazawa_sun | 0:31116bc8d4a7 | 2 | |
Komazawa_sun | 0:31116bc8d4a7 | 3 | BetaTransporter::BetaTransporter() |
Komazawa_sun | 0:31116bc8d4a7 | 4 | : pool(), |
Komazawa_sun | 0:31116bc8d4a7 | 5 | i2c(SDA,SCL) |
Komazawa_sun | 0:31116bc8d4a7 | 6 | { |
Komazawa_sun | 0:31116bc8d4a7 | 7 | |
Komazawa_sun | 0:31116bc8d4a7 | 8 | } |
Komazawa_sun | 0:31116bc8d4a7 | 9 | |
Komazawa_sun | 0:31116bc8d4a7 | 10 | bool BetaTransporter::set() |
Komazawa_sun | 0:31116bc8d4a7 | 11 | { |
Komazawa_sun | 0:31116bc8d4a7 | 12 | bool no_error = true; |
Komazawa_sun | 0:31116bc8d4a7 | 13 | |
Komazawa_sun | 0:31116bc8d4a7 | 14 | i2c.transport_begin(JUSHINKUN_ADDR, pool.ctrl.all_data, 9); |
Komazawa_sun | 0:31116bc8d4a7 | 15 | no_error = no_error & i2c.read(); |
Komazawa_sun | 0:31116bc8d4a7 | 16 | i2c.transport_end(); |
Komazawa_sun | 0:31116bc8d4a7 | 17 | |
Komazawa_sun | 0:31116bc8d4a7 | 18 | /*i2c.transport_begin(APPER_BODY_ADDR, pool.a.all_data, 4); |
Komazawa_sun | 0:31116bc8d4a7 | 19 | no_error = no_error & i2c.write(); |
Komazawa_sun | 0:31116bc8d4a7 | 20 | i2c.transport_end(); |
Komazawa_sun | 0:31116bc8d4a7 | 21 | |
Komazawa_sun | 0:31116bc8d4a7 | 22 | i2c.transport_begin(APPER_BODY_ADDR, pool.ar.all_data, 1); |
Komazawa_sun | 0:31116bc8d4a7 | 23 | no_error = no_error & i2c.read(); |
Komazawa_sun | 0:31116bc8d4a7 | 24 | i2c.transport_end(); |
Komazawa_sun | 0:31116bc8d4a7 | 25 | */ |
Komazawa_sun | 0:31116bc8d4a7 | 26 | |
Komazawa_sun | 0:31116bc8d4a7 | 27 | pool.up_load(); |
Komazawa_sun | 0:31116bc8d4a7 | 28 | |
Komazawa_sun | 0:31116bc8d4a7 | 29 | return no_error; |
Komazawa_sun | 0:31116bc8d4a7 | 30 | } |
Komazawa_sun | 0:31116bc8d4a7 | 31 | |
Komazawa_sun | 0:31116bc8d4a7 | 32 | int BetaTransporter::read(int index_num) |
Komazawa_sun | 0:31116bc8d4a7 | 33 | { |
Komazawa_sun | 0:31116bc8d4a7 | 34 | return pool.data_index[index_num]; |
Komazawa_sun | 0:31116bc8d4a7 | 35 | } |
Komazawa_sun | 0:31116bc8d4a7 | 36 | |
Komazawa_sun | 0:31116bc8d4a7 | 37 | void BetaTransporter::reset() |
Komazawa_sun | 0:31116bc8d4a7 | 38 | { |
Komazawa_sun | 0:31116bc8d4a7 | 39 | pool.reset(); |
Komazawa_sun | 0:31116bc8d4a7 | 40 | } |
Komazawa_sun | 0:31116bc8d4a7 | 41 |